是否可以从多个视图模型配置路由器?
像下面这样的东西?
class App {
...
constructor(router) {
this.router.configure(config => {
config.map([{
route: 'home',
moduleId: 'home',
nav: true
}])
})
}
}
在其他视图模型中更改路由器配置:
class SomeOtherPage {
...
constructor(router) {
this.router.configure(config => {
config.map([{
route: 'someOtherPage',
moduleId: 'someOtherPage',
nav: true
}])
})
}
}