1. 首页
  2. 考试认证
  3. 其它
  4. HandlebarsLoader简单加载车把模板的JS脚本

HandlebarsLoader简单加载车把模板的JS脚本

上传者: 2024-12-16 23:20:57上传 ZIP文件 122.9KB 热度 7次

HandlebarsLoader (v 0.2.0) 此脚本有助于轻松加载模板和部分。如何通过包管理器安装它:handlebars-loader。如何使用它初始化:

var loader = new HandlebarsLoader();

loader.load([ 'template1', 'template2', 'template3' ], ['partial1'], function() {

// templates are available...

});

使用模板:

loader.getTemplate('template1')();

轻松使用所有模板:

var templateContainer = loader.getAllTemplates();

下载地址
用户评论