lxsunbin
V2EX  ›  问与答

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

  •  
  •   lxsunbin · Sep 20, 2017 · 1638 views
    This topic created in 3332 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
    smallyin
    Sep 21, 2017
    1
    上代码呀
    谁知道你的 state 是怎样定义的。。有没有在 url 上写 `/my-url?tab`
    lxsunbin
    lxsunbin
    OP
    Sep 21, 2017
    2
    @smallyin 感觉 ui-router 屏蔽了原生的加参数方法,我现在用的 ui-router 的方法
    smallyin
    smallyin
    Sep 21, 2017
    3
    原谅我语文不好,没看懂你这句话啥意思
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4915 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 07:59 · PVG 15:59 · LAX 23:59 · JFK 02:59
    ♥ Do have faith in what you're doing.