JS中模板引擎的用法
1.art-template 是一个简约、超快的模板引擎。
它采用作用域预声明的技术来优化模板渲染速度,从而获得接近 JavaScript 极限的运行性能,并且同时支持 NodeJS 和浏览器。
2.右键下载至本地

3.在本地引入<script src="./art.js/template-web.js">(注意自己的路径不要引错)
4.引入<script type="text/html" id="aaa">(注意这里的id要写的)
5. <script type="text/javascript">
告诉模板引擎将数据与哪个模板引擎拼接
let html= template('aaa',{username:"张三",age:"18"})
// console.log(html)
document.getElementById('container').innerHTML=html
5 <div id="container">
</div>
<script src="./art.js/template-web.js">
</script>
<script type="text/html" id="aaa">
<h1>{{username}}+{{age}}</h1>
</script>
<script type="text/javascript">
let html= template('aaa',{username:"张三",age:"18"})
// console.log(html)
document.getElementById('container').innerHTML=html
</script>(这是一个具体的小例子)