{{ }} for evaluation
{{= }} for interpolation
{{! }} for interpolation with encoding
{{# }} for compile-time evaluation/includes and partials
{{## #}} for compile-time defines
{{? }} for conditionals
{{~ }} for array iteration
{{=it.xx}} 取obj.xx的值
{{ }} 里面放if else / for 等表达式
{{!it.xx}} 取把obj.xx转义后的值
1,{{? typeof it[prop]==’object’ }} 表示条件判断,结束标签是{{?}}
2, {{?? }}是条件判断的else
3,{{ 和{{? 中均可以使用原生的js语法,如for,typeof 等
4,模板并不是一定要放在script标签中,也可以放在隐藏的div标签中
使用方法:
{{= }} for 赋值
{{ }} for evaluation
{{~ }} for for循环数组
{{? }} for if判断
{{! }} for html标签是否转义
{{# }} for compile-time evaluation/includes and partials
{{## #}} for compile-time defines
562

被折叠的 条评论
为什么被折叠?



