在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 ');
};