【文件属性】:
文件名称:zirconium:Web组件的微框架
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-14 07:33:08
JavaScript
锆
Web组件的微框架
定义自定义元素时消除不必要的仪式
提供了比普通自定义元素语法更实用的接口
微小(压缩后的<700字节)
用法
您JavaScript:
var Zr = require ( 'zirconium' ) ;
var h = require ( 'hyperscript' ) ;
var myWidget = Zr ( {
name : 'my-widget' ,
elementDidInit : function ( children ) {
return h ( 'div' , [
h ( 'div' , { style : { color : 'red' } , 'hello world' ) ,
h ( 'div' , children )
] ) ;
}
} ) ;
您的标记:
<!DOCTYPE ht
【文件预览】:
zirconium-master
----.gitignore(35B)
----package.json(880B)
----.travis.yml(65B)
----LICENSE(1KB)
----index.js(2KB)
----README.md(1KB)
----test()
--------index.js(3KB)
--------polyfilled.js(68B)