How to get the query parameters in Iron-router?

前端 未结 8 1370
不知归路
不知归路 2020-12-13 10:24

I am trying to get the query parameters in the url.

There doesn\'t seem to be an easy way to do this...

which leaves me with the feeling that I must have mis

8条回答
  •  清歌不尽
    2020-12-13 11:03

    In Iron Router 1.0.0, you need to use

    this.params.query.YOUR_PARAMETER_NAME
    

    to get it

    For example, if you route is /xxx/?a=b

    this.params.query.a
    

    outputs 'b'

提交回复
热议问题