1.模板引擎
1.1 模板引擎的基本概念

1.2 什么是模板引擎
不需要再用字符串拼接
1. 3模板引擎的好处

1.4 art-template模板引擎
art-template 是一个简约、超快的模板引擎。
中文官网首页为 http://aui.github.io/art-template/zh-cn/index.html
1.4.1 art-template模板引擎的基本使用

1.用传统方式渲染UI结构
2. art-template的使用步骤
-
导入 art-template
-
定义数据
-
定义模板
-
调用 template 函数
-
渲染HTML结构
3. art-template的标准语法



if为true,按需输出内容,false内容不会被输出



filterName是个函数名可以改但必须保持一致 {{value | filterName}}
filterName函数处理前面拿来的value值,
处理结果最终return到{{value | filterName}}双花括号所占的位置上去

月份从0开始,所以加1
下为art-template标准语法使用及模板案例:














![[附源码]Nodejs计算机毕业设计基于的服装商城系统Express(程序+LW)](https://img-blog.csdnimg.cn/1b4b65459c1946abb894a5d018f59268.png)







