1
目標:能夠直接鏈接到配置文件頁面或刷新頁面。流星鐵路由器配置文件頁面刷新不起作用
問題:如果您訪問此配置文件頁面(https://pimp_stack.meteor.com/pevprofile/PqZrKZYTfy7EHfQei),您會看到頁面幾秒鐘,然後將您重新路由到主頁。
如何留在個人資料頁面?
路由代碼:
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>
您確認這個功能正常嗎? –