think-template-dustjs
v0.0.1
Published
async template engine dustjs adapter for ThinkJS2.x
Downloads
3
Readme
think-template-dustjs
Install
npm install think-template-dustjs
How to use
register adapter
import DustjsAdapter from 'think-template-dustjs';
think.adapter('template', 'dustjs', DustjsAdapter);
add above code in bootstrap file, like src/common/bootstrap/adapter.js
.
change view type
change view type in file src/common/config/view.js
:
export default {
type: 'dustjs',
adapter: {
dustjs: { //dustjs options
//set prerender function if you want extend your dust template
prerender(options, dust, templateFile) {
},
cache: false,
whitespace: false
}
}
LICENSE
MIT