全国工厂的网站建设,全球访问量最大的网站,网站内容页收录,东莞网站建站公司转载自 art-template 安装
安装
Npm npm install art-template --save在浏览器中实时编译
下载#xff1a;lib/template-web.js#xff08;gzip: 6kb#xff09;
兼容
IE8#xff08;IE8 需要补丁才能运行。示例#xff09;
差异
因为浏览器不支持文件系统#x…转载自 art-template 安装
安装
Npm npm install art-template --save在浏览器中实时编译
下载lib/template-web.jsgzip: 6kb
兼容
IE8IE8 需要补丁才能运行。示例
差异
因为浏览器不支持文件系统所以 template(filename, data) 不支持传入文件路径它内部使用 document.getElementById(filename).innerHTML 来获取模板例如 script srclib/template-web.js/script
script idtpl-user typetext/html
{{if user}}h2{{user.name}}/h2
{{/if}}
/script在浏览器中预编译
使用 Webpack 的 Loader: art-template-loader。
插件
Webpack: art-template-loaderExpress: express-art-templateKoa: koa-art-template