错误自定义流星中的路由

时间:2016-09-17 09:46:49

标签: meteor meteor-accounts

我在左侧菜单中有静态登录和注册按钮。我需要将它们配置到各自的页面。但我得到以下错误。

BlazeLayout警告:未知模板"未定义"

这是routes.js

AccountsTemplates.configureRoute('signIn', {
  name: 'signin',
  path: '/signin',
});

AccountsTemplates.configureRoute('signUp', {
  name: 'join',
  path: '/join',
});

和我的.html是:

{{#if userMenuOpen}}
          <a class="js-logout">{{_ 'Logout'}}</a>
        {{/if}}
      </div>
    {{else}}
      <div class="btns-group">
        <a href="{{pathFor 'signin'}}">{{_ 'Sign In'}}</a>
        <a href="{{pathFor 'join'}}">{{_ 'Join'}}</a>
      </div>
    {{/if}}

我还配置了布局

AccountsTemplates.configure({
  showForgotPasswordLink: true,
  texts: {
  errors: {
   loginForbidden: TAPi18n.__('Incorrect username or password'),
  pwdMismatch: TAPi18n.__('Passwords don\'t match'),
},
title: {
  signIn: TAPi18n.__('Sign In'),
  signUp: TAPi18n.__('Register'),
 },
},
 defaultTemplate: 'Auth_page',
 defaultLayout: 'Appbody',
 defaultContentRegion: 'main',
 defaultLayoutRegions: {},
});

Appbody:

<template name="Appbody">
<div id="contain" class="{{menuOpen}} {{cordova}}">
<header>
<section id="menu">
    <ul id="slide-out" class="side-nav fixed collection">

        <li><div class="userView">
          <img class="background logo" src="/images/logo-cerner.png">
        </div></li>
        <li>
        {{#if currentUser}}
      <div class="btns-group-vertical">
        <a href="#" class="js-user-menu">
          {{#if userMenuOpen}}
            <span class="material-icons">import_export</span>
            {{else}}
            <span class="material-icons">import_export</span>
          {{/if}}
          <!-- {{currentUser.emails[0]}} -->
          {{emailLocalPart}}
        </a>
        {{#if userMenuOpen}}
          <a class="js-logout">{{_ 'Logout'}}</a>
        {{/if}}
      </div>
    {{else}}
      <div class="btns-group">
        <a href="{{pathFor 'signin'}}" class="btn-secondary">{{_ 'Sign In'}}</a>
        <a href="{{pathFor 'join'}}" class="btn-secondary">{{_ 'Join'}}</a>
      </div>
    {{/if}}

    </li>
        <li>
            <form class="add-new-board">
                <div class="input-field">
                    <input type="text" placeholder="Add New Board" />
                </div>
                <button class="btn waves-effect waves-light">Submit</button>
            </form>
            {{> boards}}
        </li>
    </ul>
    <a href="#" data-activates="slide-out" class="button-collapse"><i class="material-icons">menu</i></a>
   </section>
   </header>
   <main>
   <div class="container">
{{#if currentUser}}
                <div class="row">
                    <div class="col s6">
                      {{> goodForm}}
                      {{> goods}}
                    </div>
                    <div class="col s6">
                      {{> badForm}}
                      {{> bads}}
                    </div>
                </div>
            {{/if}}
    <div class="row">
        <div class="col s12 m8 l9">
            {{#if currentUser}}
            {{#momentum plugin="fade"}}
        {{> Template.dynamic template=main}}
          {{/momentum}}
    {{else}}
                {{> atForm}}
            {{/if}}
        </div>
    </div>
</div>
</main>

AuthPage:

<template name="Auth_page">
<div class="page auth">
<nav>
  <div class="nav-group">
    <a href="#" class="js-menu nav-item">
      <span class="icon-list-unordered"></span>
    </a>
  </div>
</nav>

<div class="content-scrollable">
  <div class="wrapper-auth">
    {{> atForm}}
  </div>
</div>
</div>
</template>

0 个答案:

没有答案