繁体   English   中英

Aurelia href.bind无法正常工作

[英]Aurelia href.bind is not working

我的路线:

{ 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" >

这可以在备忘单中“路由”部分的“生成路由URL”子部分中找到

<a href.bind="route: weatherd, params.bind: { woeid: cityId }">

应该

<a route-href="route: weatherd; params.bind: { woeid: cityId }">

使用route-href,并使用分号而不是逗号。

替换,通过;

<a route-href="route: weatherd; params.bind: { woeid: cityId }"></a>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM