javascript - How to get query string in Polymer - Stack Overflow

Is there anyway how can I get query string in Polymer?http:localhost:8080search?param=ppsheinI want

Is there anyway how can I get query string in Polymer?

http://localhost:8080/search?param=ppshein

I want to get search?param=ppshein or param=ppshein in Polymer.

I've tried to get query string in app-route but it display nothing.

<app-route
    route="[[route]]"
    pattern="/:id"
    data="{{routeData}}"></app-route>

[[routeData.id]] **

Is there anyway how can I get query string in Polymer?

http://localhost:8080/search?param=ppshein

I want to get search?param=ppshein or param=ppshein in Polymer.

I've tried to get query string in app-route but it display nothing.

<app-route
    route="[[route]]"
    pattern="/:id"
    data="{{routeData}}"></app-route>

[[routeData.id]] **
Share Improve this question edited Jan 26, 2017 at 10:56 tony19 139k23 gold badges278 silver badges348 bronze badges asked Nov 18, 2016 at 3:20 Pyae Phyoe SheinPyae Phyoe Shein 13.8k47 gold badges152 silver badges243 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You could use <app-location>.queryParams:

<app-location route="{{route}}" query-params="{{queryParams}}"></app-location>

queryParams is an object containing key/value pairs of the parsed query parameters. Given http://localhost:8080/search?param=ppshein, queryParams would be:

{
  param: 'ppshein'
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745438866a4627737.html

相关推荐

  • javascript - How to get query string in Polymer - Stack Overflow

    Is there anyway how can I get query string in Polymer?http:localhost:8080search?param=ppsheinI want

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信