Comments (1)
Nuclear目前支持下面两种方式的嵌套:
var TodoList = Nuclear.create({
render: function () {
return '<ul> {{#items}} <li>{{.}}</li> {{/items}}</ul>';
}
});
var TodoApp = Nuclear.create({
install: function () {
this.todoList = new TodoList( this.option)
},
onRefresh: function () {
this.form = this.node.querySelector("form");
this.textBox = this.node.querySelector("input");
this.form.addEventListener("submit", function (evt) {
evt.preventDefault();
this.option.items.push(this.textBox.value);
}.bind(this), false);
},
render: function () {
return '<div>\
<h3>TODO</h3>'
+ this.todoList.render()+
'<form >\
<input type="text" />\
<button>Add #{{items.length}}</button>\
</form>\
</div>';
}
});
new TodoApp({ items: [] },"#container");
var TodoList = Nuclear.create({
render: function () {
return '<ul> {{#items}} <li>{{.}}</li> {{/items}}</ul>';
}
});
var TodoApp = TodoList.create({
onRefresh: function () {
this.form = this.node.querySelector("form");
this.textBox = this.node.querySelector("input");
this.form.addEventListener("submit", function (evt) {
evt.preventDefault();
this.option.items.push(this.textBox.value);
}.bind(this), false);
},
render: function () {
return '<div>\
<h3>TODO</h3>'
+this._super()+
'<form >\
<input type="text" />\
<button>Add #{{items.length}}</button>\
</form>\
</div>';
}
});
new TodoApp( { items: [] },"#container");
from omi.
Related Issues (20)
- 设置主题色报错 HOT 1
- taro 的模板没有
- Cax如何启用同层渲染?
- README里提到的omi-kbone-snake点击进入后404 HOT 1
- 当自定义的元素接收Object参数时,某些合法数据,正则校验处理有问题,会导致JSON.parse报错 HOT 3
- feature: TDesign link component HOT 3
- RFC: TDesign Omi Roadmap HOT 41
- store 的 ignoreAttrs 可以去掉了,因为 h 函数都自动注入了 ignoreAttrs
- [OMI ADMIN]i18n select center fixed HOT 6
- > 点错了
- Uncaught The provide prop was not found on the parent node or the provide type is incorrect. provide和inject的使用问题 HOT 3
- Watermark
- popup报错 —— v7.0.0-alpha2 HOT 2
- 1
- omiu 有开源吗?没有找到相关文档和组件配置 HOT 2
- <></>里的 createRef 被重建了
- 能否支持在 web component 中引入 JSX 组件? HOT 3
- effect is running for every dependecy HOT 1
- [omi-templates]完成调查问卷页的黑夜模式的适配
- [omi-templates]页面滚动自动切换右边的导航active项
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from omi.