【发布时间】:2017-07-30 00:10:32
【问题描述】:
我想用路由“/”和“/home”显示名为“home”的模板,但我的代码不起作用
/** Iron router config file **/
Router.configure({
layoutTemplate: 'layout',
notFoundTemplate: '404',
loadingTemplate: 'loading',
fastRender: true,
});
// Home
Router.route('/', {
name: 'home',
waitOn: function() {
return [
Meteor.subscribe('infosContainers'),
Meteor.subscribe('infosMachines'),
Meteor.subscribe('alertes'),
];
},
fastRender: true,
});
Router.route('/home', {
name: 'home',
waitOn: function() {
return [
Meteor.subscribe('infosContainers'),
Meteor.subscribe('infosMachines'),
Meteor.subscribe('alertes'),
];
},
fastRender: true,
});
它不喜欢模板“家”在 2 条路线中的事实(因为如果我在第二条路线中设置 name: sokasok 它可以工作)
你能帮我吗?
【问题讨论】:
标签: templates meteor iron-router