美文网首页
Thinkjs的视图

Thinkjs的视图

作者: zhangtaiwei | 来源:发表于2017-04-24 10:59 被阅读0次

    视图

    视图即模版,默认的根目录为 view/。

    视图文件

    视图文件默认的命名规则为 模块/控制器_操作.html。

    假如 URL home/article/detail 解析后的模块是 home,控制器是 article,操作是 detail,那么对应的视图文件为 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();
      }
    

    结果会返回模块view/home/article_index.html页面给前端展示

    相关文章

      网友评论

          本文标题:Thinkjs的视图

          本文链接:https://www.haomeiwen.com/subject/lyguzttx.html