我的路线:
{ route: 'weather/:woeid', href: '#/weather', name: 'weatherd', moduleId: 'weatherd', nav: true, title: 'Weather' }
我的 HTML:
<a href.bind="route: weatherd, params.bind: { woeid: cityId }">
我想建立这个网址
#/weather/23423
我很难做到这一点。他们的文档中没有任何内容。 请大家帮忙
最佳答案
在这种情况下,您希望使用route-href 而不是 href.bind。
<a route-href="route: weatherd, params.bind: { woeid: cityId }">
您可以像这样使用 href.bind:
<a href.bind="'weather/' + cityId" >
这可以在备忘单here中路由部分的“生成路由URL”小节中找到。
关于javascript - Aurelia href.bind 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47441179/