UNPKG
easygo
Version:
latest (2.5.2)
2.5.2
2.5.1
2.5.0
2.4.0
2.3.8
2.2.8
2.1.8
2.1.7
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
easygo
github.com/bigcui/easygo
bigcui/easygo
easygo
/
lib
/
util
/
render.js
18 lines
(15 loc)
•
315 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/** *
@file
模板渲染器引擎 *
@author
*/
const
etpl
=
require
(
'etpl'
);
const
engine
=
new
etpl.
Engine
({
commandOpen
:
'{%'
,
commandClose
:
'%}'
}); module.exports = { render:
function
(
template, data
)
{
const
renderer
= engine.
compile
(template);
return
renderer
(data); } };