基础核心代码
var template = require('art-template');
var tName = new Date().getTime();
var htmlT = '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title></title></head><body><h1>{{title}}</h1></body></html>';
template(tName, htmlT);
var html = template.renderFile(tName, {title: '大家好,我叫小白~'});
console.log("结果: " + html);
res.end();
运行结果:

最后
以上就是难过芒果最近收集整理的关于nodejs基于art-template模板引擎生成的全部内容,更多相关nodejs基于art-template模板引擎生成内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复