coolair
V2EX  ›  问与答

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

  •  
  •   coolair · Jan 18, 2021 · 1029 views
    This topic created in 2145 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
    clf
    Jan 18, 2021
    1
    watch 监听$route()就行了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1066 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 18:59 · PVG 02:59 · LAX 10:59 · JFK 13:59
    ♥ Do have faith in what you're doing.