我想在 durandal js 中使用默认路由发送参数。
{ route: '', title: 'Welcome', moduleId: 'viewmodels/welcome', nav: true },
喜欢
{ route: 'test/:id', moduleId: 'viewmodels/test', nav: true },
但不幸的是我做不到。 我想将网址设置为 'http://domainname.com/123 ' 其中 '123' 是参数(id)。 'http://domainname.com/#test/123 ' 根据第二条路线为我工作。 谁能帮帮我吗?
最佳答案
据我所知,这是不可能的 - 这是设计使然。 您可以引用Durandal's own documentation on the router还有这个post in Google Groups Rob Eisenberg(Durandal 的创建者)本人就该主题提供了一个明确的答案。
关于javascript - Durandal 路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23670022/