【发布时间】:2018-01-01 01:55:54
【问题描述】:
使用 Aurelia,如何使用route-href 构造引用子路由的锚标记 href?
在 app.js 中,定义到父视图的路由。
config.map([
{
route: 'parentview,
name: 'parentview',
moduleId: './parentview'
}]);
在 parentview.js 中,配置到子视图的路由:
config.map([
{
route: ['', 'childviewone'], name: 'childviewone', moduleId: './childviewone' },
route: 'childviewtwo', name: 'childviewtwo', moduleId: './childviewtwo' }
]);
我发现没有办法使用route-href 构造一个类似于“parentview/childviewone”或“parentview/childviewtwo”的锚标记href。
这似乎是一个简单且可能很常见的场景。也许以下问题正在阻碍?还是我错过了什么?
【问题讨论】:
-
您目前如何尝试使用
route-href? -
@thebluefox 你有什么想法可行吗?