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

0.1.3 • 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)

Readme

Keywords

Package Sidebar

Install

npm i @newy/html

Weekly Downloads

291

Version

0.1.3

License

MIT

Unpacked Size

18 kB

Total Files

7

Last publish

Collaborators

  • newy