art-template 模板引擎
来源:互联网 发布:二战陆军实力排名 知乎 编辑:程序博客网 时间:2024/05/20 10:12
今天我总结一下art-template 模板引擎这个框架,比较简单
一、文档,以及GitHub
文档: https://aui.github.io/art-template/docs/index.html
GitHub: https://github.com/aui/art-template
二、art-template 的书写方式:
1.原始语法
<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>demo</title> <script src="js/artTemplate.js"></script></head><body><!--包裹元素--><div id="content"></div><script id="test" type="text/html"> <%if(admin){%> <% for(var i=0; i<list.length; i++){%> <div><%=i%>:<%=list[i]%></div> <%}%> <%}else{%> <div>没有结果!</div> <%}%> <!--赋值方法--> <p><%=person.eatting()%></p> <h2><% a=person.age %></h2> <% for(var i=0;i<a.length;i++){ %> <p><%=a[i] %></p> <%}%> <!--$imports 代表console--> <% $imports.log('hello world') %></script><script type="text/javascript" src="js/art-template.js"></script><script type="text/javascript"> var data = { admin: true, list : ["第一个元素","第二个元素"], person:{ name:"Jhon", age:[23,24,54,36,56,23,64], eatting:function(){ console.log("我吃了一个大西瓜"); } } }; template.defaults.imports.log = console.log; // 此处展示imports的作用 var html = template('test',data);// test 为模板ID, data数据 // console.log(html) document.getElementById("content").innerHTML = html;</script></body></html>
阅读全文
0 0
- art-template 模板引擎
- js模板引擎-art-template常用总结
- js模板引擎-art-template常用总结
- javascript模板引擎:art-template文档笔记
- js模板引擎art-template.js使用方法
- 高性能art-template模板引擎的使用
- art-template模板中的template.helper( )
- 模板引擎Template
- javascript中的模板引擎template
- SpringBoot 模板引擎 Template engines
- template js javascript模板引擎
- nodejs中art-template模板语法冲突解决方案
- nodejs中art-template模板语法冲突解决方案
- Beyond The Template Engine超越模板引擎
- Velocity模板引擎(template engine)
- 尝试使用google-template模板引擎
- node template engine节点模板引擎
- template.js前端模板引擎使用
- 强强联手!博纳影业携中企动力开拓互联网+战略性合作
- monkey测试
- mysql插入或更新字段有大数据时(大于1M)出现问题
- 使用POI给word中的表格增加行
- Day1-4.Scoping
- art-template 模板引擎
- Echarts词云图自定义图案
- 【总结】Python 2.x中常见字符编码和解码方面的错误及其解决办法
- 训练的神经网络的常见问题
- 几维安全提醒勒索病毒又来袭 网络安全行业或迎机遇
- 第5条:避免创建不必要的对象
- 中企动力:用产品化思维打磨“管家服务”
- Java数据类型和MySql数据类型对应表
- servlte