1. 概述
art-template
的GitHub仓库:https://github.com
art-template
的官方文档:https://github.com/aui/art-template
art-template
主要用于客户端
art-template
模板引擎不仅可以在浏览器使用,也可以在node中使用
- 模板引擎最早诞生于服务器领域,后来才发展到前端
- art-template 模板引擎,属于第三方模块
2. art-template
的安装
- 安装命令:
npm install art-template --save
- 该命令在哪执行就会把包下载到哪里,默认下载到
node_modules
目录中
3. art-template
浏览器中使用
<script src="node_modules/art-template/lib/template-web.js"></script>
<script type="text/template" id="tpl">
hello {
{
name}}
</script>
<script>
var ret = template('tpl', name