我有以下路线:
router.map([
{ url: 'home', moduleId: 'viewmodels/home', name: 'Home', visible: false },
{ url: 'my', moduleId: 'viewmodels/folder', name: 'My Content', visible: false }, // Should display contents of /folder/2
{ url: 'public', moduleId: 'viewmodels/folder', name: 'Public Content', visible: false }, // Should display contents of /folder/3
{ url: 'set/:id', moduleId: 'viewmodels/set', name: 'Set', visible: false },
{ url: 'folder/:id', moduleId: 'viewmodels/folder', name: 'Folder', visible: false }
]);
我想添加这样的内容:
{ url: 'test', moduleId: 'viewmodels/folder', id: '2', name: 'Specific Folder', visible: false }
导航到“测试”的位置向我显示 /folder/2(但 url 保持 /test)。如何使用 durandal 路由器实现此目的?