Meteor iron路由器配置文件页面刷新不工作
目标:能够直接链接到个人资料页面或刷新页面 问题:如果您访问此配置文件页(),您会看到该页几秒钟,然后您会被重新路由到主页 如何保持在个人资料页面上 路由代码:Meteor iron路由器配置文件页面刷新不工作,meteor,refresh,iron-router,Meteor,Refresh,Iron Router,目标:能够直接链接到个人资料页面或刷新页面 问题:如果您访问此配置文件页(),您会看到该页几秒钟,然后您会被重新路由到主页 如何保持在个人资料页面上 路由代码: Router.route('/', function () { // render the Home template with a custom data context this.render('Home'); }); // Login / Logout Router.route('/login'); Router.ro
Router.route('/', function () {
// render the Home template with a custom data context
this.render('Home');
});
// Login / Logout
Router.route('/login');
Router.route('/logout', function () {
Meteor.logout();
this.render('Home');
});
// given a url like "/pevprofile/<id>
Router.route('/pevprofile/:_id', function () {
this.render('/pevprofile');
});
<template name="pevprofile">
<div class="container-fluid">
<h2>Profile</h2>
{{> PevDetails}}
</div>
</template>
<template name="PevDetails">
PEV Details
</template>
Router.route('/',function(){
//使用自定义数据上下文呈现主模板
这个。呈现(“家”);
});
//登录/注销
Router.route('/login');
Router.route('/logout',函数(){
Meteor.logout();
这个。呈现(“家”);
});
//给定一个类似“/pevprofile”的url/
Router.route('/pevprofile/:_id',函数(){
这个.render('/pevprofile');
});
模板代码:
Router.route('/', function () {
// render the Home template with a custom data context
this.render('Home');
});
// Login / Logout
Router.route('/login');
Router.route('/logout', function () {
Meteor.logout();
this.render('Home');
});
// given a url like "/pevprofile/<id>
Router.route('/pevprofile/:_id', function () {
this.render('/pevprofile');
});
<template name="pevprofile">
<div class="container-fluid">
<h2>Profile</h2>
{{> PevDetails}}
</div>
</template>
<template name="PevDetails">
PEV Details
</template>
轮廓
{{>PevDetails}
PEV详细信息
您可能需要重新检查此项。在我这方面工作正常。几秒钟后,我看到配置文件页面没有重定向
您可能需要重新检查此项。在我这方面工作正常。几秒钟后,我看到配置文件页面没有重定向