Open heerake opened 6 years ago
能提供具体的错误和可复现代码吗?
@danmin25
let Koa = require('koa');
let xtpl = require('xtpl/lib/koa2');
let path = require('path');
let app = new Koa();
xtpl(app, {
views: path.resolve(__dirname)
});
app.use(async (ctx) => {
ctx.body = await ctx.render('./test', {
number: 1
});
});
app.listen(3333);
test.tpl内容为
{{number.noFunc(1)}}
错误在xtpl/lib/koa2, line55 没有处理error,是故意设计成这样的么
xtplRender(filePath, context, option)((e, data) => {
content = data;
});
目前会直接吃掉异常,返回undefined的content