nodejs中引用art_template获取不到数据
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>用户列表</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h6>
<a href="add.html" class="btn btn-primary">{{title}}</a>
</h6>
<table class="table table-striped table-bordered">
<tr>
<td>用户名</td>
<td>年龄</td>
<td>爱好</td>
<td>邮箱</td>
<td>操作</td>
</tr>
<tr>
<td>张三</td>
<td>20</td>
<td>
<span>足球</span>
<span>篮球</span>
<span>橄榄球</span>
</td>
<td>zhangsan@itcast.cn</td>
<td>
<a href="" class="btn btn-danger btn-xs">删除</a>
<a href="" class="btn btn-success btn-xs">修改</a>
</td>
</tr>
</table>
</div>
</body>
<script>
</script>
</html>
const template = require('art-template')
const path = require('path')
const result = template(path.join(__dirname,'/list.html'),{
title:'标题'
})
console.log(result.title)
资源管理器 <> list.html Jsart.js 00 X
VARTTEMP... JSart.js>.
1 >node modules const template = require(art-template')
2 constpath=require(path')
.静态页面.zip
3
三数据.txt 4 const result= template(path.join(_dirname,/1ist.html'),
5 Jsart.js title:标题
<> list.html
f package-lock.json 8 console.1og(result.title)
【7 packagejson
9
调试控制台 问题 输出 终端 端口
</div>
</body>
</html>
PS E:node作F业\art template> node art
undefined
PS E:nodef 业\art _template> node art
undefined
>大纲
PS E:\node作业\art template>
>时间线
CSDN@肃渝<)