coolair
V2EX  ›  问与答

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

  •  
  •   coolair · Jan 18, 2021 · 826 views
    This topic created in 2008 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   ·   2927 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 13:16 · PVG 21:16 · LAX 06:16 · JFK 09:16
    ♥ Do have faith in what you're doing.