Use artTemplate to render view files for ThinkJs 3.x version
npm install think-view-art
const artTemplate = require('think-view-art')
exports.view = {
type:'artTemplate',
artTemplate:{
handle:artTemplate,
common: {} //thinkjs itself config
options: {
//your self config here
compileDebug:true
},
beforeRender: (art, handleOptions) => {
//do something before render the template.
}
}
}
please refer to art-template for more information on art-template options.