掌握template.render(data.toString(),{json:arr})使用
首先需要安装template.js在code里------npm i art-template
传统的模板引擎回忆
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="./node_modules/art-template/lib/template-web.js"></script>
<script type="text/template" id="template">
{
{
each json}}
<p>姓名:{
{
$value.name}}</p>
<p>年龄:{