发布于 2015-09-30 00:47:18 | 209 次阅读 | 评论: 0 | 来源: 网友投递
RegularJS JavaScript MVC 框架
regularjs是一个基于字符串模板的用于创建数据驱动的组件的类库, 相较于其它同类的基于字符串的模板引擎比如(mustache), regularjs在compile之后数据和dom仍然保持联系, 所以也称之为'live template engine'.
RegularJS v0.4.0 发布,更新内容如下:
r-component for dynamic component <r-component is={componentName} props.... />
if Express is const, now regularjs will pass a value but not a Expression like in previous version. value = {1}
, 1 will pass to directive.
$watch now accept function for watch complex value
this.$watch(function(){ return global.value}, function (gval, old_gval)) { })
#list now support alternative syntax ( {#list list as item} {item.content} {#else} list is not exsits {/list}
)
support track-by in list statement, performance is awesome now (http://leeluolee.github.io/js-repaint-perfs/).
{#list list as item by item_index} // content here won't be destroy, only updating {/list}
r-class r-style will add '{}' for you if you pass a String and missed '{}' for object literal ( "left: left + 'px'" is valid now)
更多内容及下载页面:0.4.0
regularjs是一个基于字符串模板的用于创建数据驱动的组件的类库, 相较于其它同类的基于字符串的模板引擎比如(mustache), regularjs在compile之后数据和dom仍然保持联系, 所以也称之为'live template engine'.
RegularJS 在实现上采取了angular的数据更新策略(但是提取了表达式的依赖关系以便在Object.observe正式到来时切换到脏检 查+observe的形式)提倡极致的声明式和裸数据操作, 依赖于基于字符串的模板描述结构结合更规范性的类式继承的组件体系来定义数据层的业务逻辑.
这也是框架取名 regular = react(ractive) + angular的由来