Passing query parameters using Router.go in iron router

前端 未结 4 1297
北海茫月
北海茫月 2021-02-08 14:08

I am trying to pass query parameters in Router.go like below:

var filter = \'abc\';
var path = Router.current() && Router.current().path;
Router.go(path,         


        
4条回答
  •  梦如初夏
    2021-02-08 14:48

    Right there in the docs

    Router.go('post.show', {_id: 1}, {query: 'q=s', hash: 'hashFrag'});
    

    The above JavaScript will navigate to this url:

    /post/1?q=s#hashFrag
    

    https://github.com/iron-meteor/iron-router/blob/devel/Guide.md#named-routes

提交回复
热议问题