@newy/html
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

声明式DOM库

项目地址

示例

import { tag } from '@newy/html'

let { div, a, img, h1, p, button } = tag

let dom = div(
  a`href="https://vitejs.dev" target="_blank"`(img`src=${src1} class="logo" alt="Vite logo"`),
  a`href="https://www.typescriptlang.org/" target="_blank"`(
    img`src=${src2} class="logo vanilla" alt="TypeScript logo"`
  ),
  h1('Vite + TypeScript'),
  div`class="card"`(button`id="counter" type="button"`),
  p`class="read-the-docs"`('Click on the Vite and TypeScript logos to learn more')
)

document.querySelector('body').append(dom)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.4
    58
    • latest

Version History

Package Sidebar

Install

npm i @newy/html

Weekly Downloads

155

Version

0.1.4

License

MIT

Unpacked Size

15.8 kB

Total Files

7

Last publish

Collaborators

  • newy