代码之家  ›  专栏  ›  技术社区  ›  Miguel Morujão

流量计-FlowRouter-空白页

  •  0
  • Miguel Morujão  · 技术社区  · 9 年前

    嘿,伙计们,我正在做一个关于扩展用户类的教程, Link 辅导1 在我尝试的每一条道路上,我总是得到一张空白的纸,我不明白为什么。 任何帮助都将不胜感激。 这是我的路线。js文件:

    FlowRouter.route('/', {
       name: 'home',
       action: function() {
       BlazeLayout.render("mainLayout", {
          content: "home"
       });
      }
    });
    FlowRouter.route('/login', {
       name: 'login',
       action: function() {
       BlazeLayout.render("mainLayout", {
          content: "login"
       });
      }
    });
    FlowRouter.route('/register', {
       name: 'register',
       action: function() {
       BlazeLayout.render("mainLayout", {
          content: "register"
       });
      }
    });
    

    这是我的main layout.html

    <template name="mainLayout">
        {{>Template.dynamic template=content}}
    </template>
    

    以下是我的回购链接: https://bitbucket.org/mmrj9/hubapp/src

    2 回复  |  直到 9 年前
        1
  •  2
  •   Season    9 年前

    flow-router 很好。它们可以很好地呈现静态HTML节点。

    比如说,你主页的精简版,

    <template name="home">
        Home Page.
    </template>
    

    ,按预期在客户端呈现字符串。

    我不会在这里列出问题,但希望这能为您的行动提供一些帮助。

        2
  •  1
  •   tune2fs    9 年前

    您是否定义了其他模板?

    e、 g.主页模板

    <template name="home">
        {{#with currentUser}}
        <div class="ui raised segment">
            <h1 class="ui header">Current User</h1>
            <p>First Name: {{profile.firstName}}</p>
            <p>Last Name: {{profile.lastName}}</p>
            <p>Profile Picture: <img class="ui small circular image" src="{{profile.profPicture}}" /></p>
            <p>Organization: {{profile.organization}}</p>
        </div>
        {{/with}}
    </template>