[英]Aurelia href.bind is not working
My route: 我的路线:
{ route: 'weather/:woeid', href: '#/weather', name: 'weatherd', moduleId: 'weatherd', nav: true, title: 'Weather' }
My HTML: 我的HTML:
<a href.bind="route: weatherd, params.bind: { woeid: cityId }">
I want to build this url 我想建立这个网址
#/weather/23423
I am having very hard time doing this. 我很难做到这一点。 There is nothing in their documentation.
他们的文档中没有任何内容。 Anybody please help
有人请帮忙
You want to use route-href instead of href.bind in this case. 在这种情况下,您要使用route-href而不是href.bind。
<a route-href="route: weatherd, params.bind: { woeid: cityId }">
You would use href.bind like this: 您可以这样使用href.bind:
<a href.bind="'weather/' + cityId" >
This can be found in the "Generating Route URLs" subsection of the Routing section in the cheat sheet here 这可以在备忘单中“路由”部分的“生成路由URL”子部分中找到
<a href.bind="route: weatherd, params.bind: { woeid: cityId }">
should be 应该
<a route-href="route: weatherd; params.bind: { woeid: cityId }">
Use route-href, and use a semicolon instead of a comma. 使用route-href,并使用分号而不是逗号。
Replace ,
by ;
替换
,
通过;
: :
<a route-href="route: weatherd; params.bind: { woeid: cityId }"></a>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.