在铁路由器出现之前,在视图/模板之间切换的最佳方式是什么?
现在,我可以找到一个新的位置,而铁路由器将呈现所需的模板,如下所示:
Router.route('/about', function(){
this.render('about_template',{to:'stuff'});
this.render('personnel_template',{to:'stuff'});
}, {where:'client'});但是,如果没有路线,这是如何实现的呢?当某个操作发生时,我只是呈现视图,然后手动更改URL位置吗?
发布于 2015-02-06 07:20:36
首先,确保您有正确的布局模板。
<template name="layout">
{{> yield}}
</template>像这样的配置。
Router.configure({
layoutTemplate: 'layout'
});现在试试这个。
Router.route('/about', {name: 'about_template'});像这样在HTML上打电话。
href="{{pathFor 'about_template'}}"https://stackoverflow.com/questions/28359670
复制相似问题