視圖
視圖即模版现横,默認(rèn)的根目錄為 view/。
視圖文件
視圖文件默認(rèn)的命名規(guī)則為 模塊/控制器_操作.html阁最。
假如 URL home/article/detail 解析后的模塊是 home戒祠,控制器是 article,操作是 detail闽撤,那么對(duì)應(yīng)的視圖文件為 home/article_detail.html得哆。
例子:
瀏覽器上輸入http://127.0.0.1:8360/home/article
文件在:src/home/controller/article.js
indexAction(){
//auto render template file index_index.html
//let data = {name: "馬云"};
//this.success(data);
return this.display();
}
結(jié)果會(huì)返回模塊view/home/article_index.html頁面給前端展示