在controller 定义数据
indexAction() {
this.name = 'THINK';
return this.display('index');
}
在页面渲染
<div class="content">
{{controller.name}}
</div>
日志打印
// 日志打印
think.logger.info('第一次日志');
引入静态资源文件 注意路径
<!-- 引入js -->
<script src="/static/js/index.js"></script>
<!-- 引入css -->
<link href="/static/css/index.css" rel="stylesheet" />
<!-- 引入img -->
<img src="/static/img/index.png" alt="" >
js事件执行
const dom = document.querySelector('h1');
dom.onclick = function() {
console.log(' Hello Word ');
};