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

 

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