【问题标题】:Aurelia href.bind is not workingAurelia href.bind 不工作
【发布时间】:2018-05-06 13:47:01
【问题描述】:

我的路线:

{ 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

我很难做到这一点。他们的文档中没有任何内容。 请大家帮忙

【问题讨论】:

  • 我对@9​​87654321@一无所知任何事情,但您似乎使用名为weatherd 的“路线”建立了一个链接,但这是@ 的名称您使用的 987654326@,route 称为 weather。这是故意的吗?
  • 那个风化的东西很好。

标签: javascript typescript routing aurelia


【解决方案1】:

在这种情况下,您想使用 route-href 而不是 href.bind。

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

你会像这样使用 href.bind:

<a href.bind="'weather/' + cityId" >

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

【讨论】:

    【解决方案2】:

    &lt;a href.bind="route: weatherd, params.bind: { woeid: cityId }"&gt;

    应该是

    &lt;a route-href="route: weatherd; params.bind: { woeid: cityId }"&gt;

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

    【讨论】:

      【解决方案3】:

      , 替换为;

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

      【讨论】:

        猜你喜欢
        • 2018-03-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-02-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多