handlebars的用法

原文链接: http://www.cnblogs.com/diligenceday/p/4105229.html

引入:handlebars-layouts 

引入:handlebars

自定义helper的方法:

Handlebars.registerHelper('if', function(conditional, options) {

         if(conditional) {

               return options.fn(this);

          } });

1.handlebars-layouts : {{#extend /extend }} 扩展hbs模板

 

handlebars内置的helper:

{{}}

posted @ 2017-03-02 14:11  jay-  阅读(179)  评论(0)    收藏  举报