【发布时间】:2015-09-15 21:41:53
【问题描述】:
我有以下几点:
<div class="page-host" data-bind="router: { transition:'entrance' }"></div>
使用标准路由器配置,我调用:
return router.activate('browse');
但是,我每次都会收到“你好”。我需要有条件地选择从 shell 中导航到哪条路线 - 这怎么做?
我的路由配置:
router.map([
{ route: ['', 'hello'], title: 'hello', moduleId: 'hello/hello', nav: true, allowedUsers: ['authenticated', 'unauthenticated'] },
{ route: 'browse', moduleId: 'browse/browse', nav: true, allowedUsers: ['authenticated'] },
{ route: 'resetpassword/:id', moduleId: 'forgot/reset', nav: false, allowedUsers: ['unauthenticated'] }
]).buildNavigationModel();
【问题讨论】:
-
你能澄清一下你需要有条件地选择路线吗?你的意思是说,当用户进入应用程序时,shell 需要根据一些条件有条件地选择初始路由?你能告诉我们你的条件逻辑吗?谢谢。
标签: durandal durandal-2.0