簡體   English   中英

使用Aurelia中的href發送多個數據

[英]Send multiple data using href in Aurelia

如何在Aurelia中使用href發送多個數據?

This works: <a href="#/candidate/upload/${cid}?t=${item.heading}">

只需要語法。

Not working:<a href="#/candidate/upload/${cid}?t=${item.heading};s=${item.sw_casedocumentid}">

可以使用route-href自定義屬性來完成。 我猜你有一個看起來像這樣的路由配置:

{ route: 'candidate/upload/:cid', name: 'upload', ... }

路由器的妙處在於,如果您將路由中不存在的參數傳遞給它,它將僅將它們添加到查詢字符串中:

<a route-href="route: 'upload', 
               params.bind: { cid: cid; t: item.heading; s: item.sw_casedocumentid }"></a>

這將產生一個鏈接,該鏈接看起來像您想要的樣子。

解決方案:只需要在數據之間添加&

<a href="#/candidate/upload/${cid}?t=${item.heading}&s=${item.sw_casedocumentid}">

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM