<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./node_modules/art-template/lib/template-web.js"></script>
</head>
<body>
<script type="text/template" id="template">
<!--<h1>模板的引擎:{{value}}</h1>-->
{{each arr}}
<p>{{$value.name}}</p>
<p>{{$value.age}}</p>
{{/each}}
</script>
<script>
// let v = "模板模板"
// let html = template("template",{
// value:v
// })
let arr = [
{
name:'zheng',
age:19
} ,
{
name:'lili',
age:10
},
]
let html = template('template',{
arr:arr
})
console.log(html);
</script>
</body>
</html>
【模板引擎】
最新推荐文章于 2024-07-22 15:57:03 发布