coolair
V2EX  ›  问与答

vue 同一页面跳转怎么获取参数?

  •  
  •   coolair · Jan 18, 2021 · 785 views
    This topic created in 1964 days ago, the information mentioned may be changed or developed.

    http://localhost/#/test
    页面有个链接:
    http://localhost/#/test?q=123
    点击后怎么获取 q 的值? mounted 里不行,因为已经 mounted 了。
    1 replies    2021-01-18 11:09:53 +08:00
    clf
        1
    clf  
       Jan 18, 2021
    watch 监听$route()就行了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3885 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 05:08 · PVG 13:08 · LAX 22:08 · JFK 01:08
    ♥ Do have faith in what you're doing.