模板引擎 ETPL

码农软件 · 软件分类 · 模板引擎 · 2019-08-23 13:41:50

软件介绍

ETPL是一个灵活、具有强大复用能力的高性能的模板引擎,适用于WEB前端应用中视图的生成,特别是SPA(Single Page APP)类型的应用。

ETPL可以在CommonJS/AMD的模块定义环境中使用,也可以直接在页面下通过<script src=的方式引用。CommonJS/AMD环境下需要通过如下代码得到ETPL的模块。

var etpl = require( 'etpl' );

得到ETPL模块对象后,首先对模板源代码进行编译,就能够得到模板编译后的function

var render = etpl.compile( 'Hello ${name}!' );

然后执行这个function,传入数据对象,就能得到模板执行的结果了。

var text = render( {name: 'etpl'} );

本文地址:https://codercto.com/soft/d/12995.html

JavaScript: The Definitive Guide, 5th Edition

JavaScript: The Definitive Guide, 5th Edition

David Flanagan / O'Reilly Media / 2006-08-01 / USD 49.99

This Fifth Edition is completely revised and expanded to cover JavaScript as it is used in today's Web 2.0 applications. This book is both an example-driven programmer's guide and a keep-on-your-desk ......一起来看看 《JavaScript: The Definitive Guide, 5th Edition》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具