“余烬”链接到“帮助者以支持“锚点跳转到页面中的元素” [英] ember "link-to" helper to support "anchor to jump to an element in the page"
问题描述
我想在链接中传递queryparams和anchor元素名称。像这样
I want to pass queryparams and anchor element name in the link-to. like this
localhost.domain.com?get=100&interviewId=11#4
我使用查询参数来构造get = 100& interview = 11,这样的事情
I used query params to construct get=100&interview=11 , something like this
{ {#link-to'domain.url'(query-params get = 100
interviewId = 11)class =btn btn-info}}
{{#link-to 'domain.url' (query-params get=100 interviewId=11)class="btn btn-info"}}
链接
{{/ link-to}}
{{/link-to}}
How to generate the link with anchor using ember link-to ?
注意:需要只有链接的解决方案,< a href = >
不需要
Note: Need solution with link-to only, <a href="">
is not needed
推荐答案
安装 ember-href-to addon,
ember install ember-href-to
您可以使用href-to helper来生成URL提供queryParams和routeName。
You can use href-to helper to generate URL by providing queryParams and routeName.
(concat (href-to 'domain.url' (query-params get=100 interviewId=4)) propName)
这篇关于“余烬”链接到“帮助者以支持“锚点跳转到页面中的元素”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!