cell 介绍
cell 一个 由自驱动、自构建的Web应用程序框架。 ?Cell只有 一个 设计目标: 简单,易于学习和使用。
cell的使用
<html>
<script src="https://www.celljs.org/cell.js"></script>
<script>
var el = {
$cell: true,
style: "font-family: Helvetica; font-size: 14px;",
$components: [
{
$type: "input",
type: "text",
placeholder: "Type something and press enter",
style: "width: 100%; outline:none; padding: 5px;",
$init: function(e) { this.focus() },
onkeyup: function(e) {
if (e.keyCode === 13) {
document.querySelector("#list")._add(this.value);
this.value = "";
}
}
},
{
$type: "ol",
id: "list",
_items: [],
$components: [],
_add: function(val) { this._items.push(val) },
$update: function() {
this.$components = this._items.map(function(item) {
return { $type: "li",$text: item }
})
}
}
]
}
</script>
</html>
代码 中需要注意的几件事:
没有要继承和扩展的框架类。
没有API 方法 调用 。
没有html正文 标记 。
我们所拥有的只是 一个 类似jsON的变量。
DOM只是在没有运行任何 功能 的情况下构建自己。
网站地址 : https://www.celljs.org
GitHub: https://github.com/intercellular/cell
网站描述: 一个 自驱动的Web应用程序框架
cell官方网站
官方网站: https://www.celljs.org
如果觉得 网站内容还不错,欢迎将 网站 推荐给程序员好友。