egg-view-htmling
v1.0.2
Published
基于htmling的eggjs模板插件
Downloads
13
Maintainers
Readme
egg-view-htmling
egg view plugin for htmling.
Install
$ npm i egg-view-htmling --save
Usage
// {app_root}/config/plugin.js
exports.htmling = {
enable: true,
package: 'egg-view-htmling',
};
// {app_root}/config/config.default.js
exports.view = {
mapping: {
'.html': 'htmling',
},
};
// htmling config
exports.htmling = {};
Create a htmling file
// app/view/hello.html
hello {{data}}
Render it
// app/controller/render.js
exports.htmling = async ctx => {
await ctx.render('hello.html', {
data: 'world',
});
};