Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

xtemplate: change syntax #570

Closed
yiminghe opened this Issue · 2 comments

2 participants

@yiminghe
  • [!] 去除二义性,不兼容 mustache,if each 等必须显示指定。提高性能。 http://jsperf.com/jade-xtpl
  • [!] 改变语法,命令调用必须加括号,参数以逗号分隔,空格无意义。例如 {{#if(x > 1)}}{{/if}} {{each(data,"x")}}{{/each}}
  • [!] 不支持 {{^ ,用 ! 替代. 例如 {{^if x}} => {{if(!x)}}
  • [+] 支持命令的嵌套调用 {{join( map(users) )}},例如

    XTemplate.addCommand('range', function(scope,options){
        var ret=[];
        for(var i=options.params[0];i<options.params[1];i++){
           ret.push(i);
        }
        return ret;
    });
    
    {{#each (range(1,7))}}
    {{this}}
    {{/each}}
@yiminghe yiminghe closed this in cbf6298
@daxingplay

这个改动是放在KISSY哪个版本里面了?

@yiminghe

1.5

@yiminghe yiminghe added this to the 5.0.0 milestone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.