[英]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.