lxsunbin
V2EX  ›  问与答

angularjs 使用 ui-router 无法在 url 上增加参数吗?

  •  
  •   lxsunbin · Sep 20, 2017 · 1391 views
    This topic created in 3166 days ago, the information mentioned may be changed or developed.

    $location.search('tab', 1) 我使用上面这个方法给 url 添加参数,虽然 url 上没有显示,但是$location.search()可以查找到,但是刷新后参数就没了,而且进行路由切换(ui-router)的时候这个参数会在 url 上闪一下就没了,求解如何解决?

    3 replies    2017-09-21 11:06:54 +08:00
    smallyin
        1
    smallyin  
       Sep 21, 2017
    上代码呀
    谁知道你的 state 是怎样定义的。。有没有在 url 上写 `/my-url?tab`
    lxsunbin
        2
    lxsunbin  
    OP
       Sep 21, 2017
    @smallyin 感觉 ui-router 屏蔽了原生的加参数方法,我现在用的 ui-router 的方法
    smallyin
        3
    smallyin  
       Sep 21, 2017
    原谅我语文不好,没看懂你这句话啥意思
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2962 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 05:34 · PVG 13:34 · LAX 22:34 · JFK 01:34
    ♥ Do have faith in what you're doing.