-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
与 templatable 区别
- runtime 直接给 handlebars 用的,template 只支持函数
- 模板以 .handlebars 结尾,spm 会编译成 cmd 模块,开发环境使用 plugin-handlebars.js
- 用户使用的时候需要自己编译模板,实例化的时候无法传入字符串。所以比较适合像 calendar 这种没啥修改模板的组件
- 去掉 renderPartial
- 增加 compile 方法,重新全局渲染
- 不再使用 this.model 和 this.template,取而代之使用属性
review 下现有代码
https://github.com/aralejs/templatable/blob/master/src/runtime.js
compile 也可以支持简单的 selector
- 用 jquery 实现
this.element.html($(this._compile()).find(selector).html());
- 用正则匹配,不过只能支持常使用的选择器
Metadata
Metadata
Assignees
Labels
No labels