think 數據

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章