簡體   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