1
不显示用户我使用useraccounts:导流与useraccounts:兑现 & kadira:闪耀布局。 FlowRouter将根据声明导航到表单页面,但仍显示'/'路线。AccountsTemplates在FlowRouter/BlazeLayout
我已经在routes.js中声明了AccountsTemplates配置,并试图单独声明它无济于事。
我应该如何构造这个不同,以使useraccounts:flow-routing显示与流量路由器帐户模板?
进口/启动/客户/ routes.js
import { FlowRouter } from 'meteor/kadira:flow-router';
import { BlazeLayout } from 'meteor/kadira:blaze-layout';
import { AccountsTemplates } from 'meteor/useraccounts:core';
// Import needed templates
import '../../ui/layouts/body/body.js';
import '../../ui/pages/home/home.js';
import '../../ui/pages/not-found/not-found.js';
import '../../ui/pages/login/login_page.js';
// Account Templates
AccountsTemplates.configure({
defaultLayout: 'App_body',
defaultLayoutRegions: {},
defaultContentRegion: 'main',
enablePasswordChange: true,
showForgotPasswordLink: true,
sendVerificationEmail: true,
confirmPassword: false,
});
AccountsTemplates.configureRoute('changePwd');
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('signIn', {
path: '/login',
});
AccountsTemplates.configureRoute('signUp');
AccountsTemplates.configureRoute('verifyEmail');
// Set up all routes in the app
FlowRouter.route('/', {
name: 'App.home',
action() {
BlazeLayout.render('App_body', { main: 'App_home' });
},
});
FlowRouter.notFound = {
action() {
BlazeLayout.render('App_body', { main: 'App_notFound' });
},
};
/imports/ui/layouts/body/body.html
<template name="App_body">
<div class="wrapper">
<nav>
<div class="nav-wrapper">
<a href="{{pathFor '/'}}" class="brand-logo">Pair of Losers</a>
<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li><a href="sass.html">Sass</a></li>
<li><a href="badges.html">Components</a></li>
<li><a href="collapsible.html">Javascript</a></li>
<li><a href="mobile.html">Mobile</a></li>
</ul>
<ul class="side-nav" id="mobile-demo">
<li><a href="{{pathFor '/login'}}">Login</a></li>
<li><a href="{{pathFor '/sign-up'}}">Sign Up</a></li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-xs-12">
{{> Template.dynamic template=main}}
</div>
</div>
</div>
</div>
</template>
尽管文档声称在路由前使用'configureRoute',我在样板中找到'useraccounts:materialize',在正常路由之后配置路由。 ♂️,想尝试一下,看看它是否有帮助? https://github.com/meteor-useraccounts/boilerplates/blob/master/materialize-flow-router/lib/router/routes.js –