1.关键字 $imports.+变量/函数函数
{{if $imports.myParseInt(b.health_money)}} <span class="num">+{{b.health_money}}积分</span> {{else}} <span class="num org">{{b.health_money}}积分</span> {{/if}}
<img src="{{$imports.url+ data.img}}" alt="">
2.拓展方法url
template.defaults.imports.+方法名 = function ( 参数 ) {spa
}code
template.defaults.imports.myParseInt = function (str) { if ( parseInt(str) > 0 ) { return 1; } else { return 0; } };
使用blog
<span class="num org">{{b.health_money | myParseInt}}</span>