How can I get query parameters from a URL in Vue.js?

后端 未结 9 1496
甜味超标
甜味超标 2020-12-12 13:47

How can I fetch query parameters in Vue.js?

E.g. http://somesite.com?test=yay.

Can’t find a way to fetch or do I need to use pure JS or some lib

9条回答
  •  一向
    一向 (楼主)
    2020-12-12 14:51

    You can get By Using this function.

    console.log(this.$route.query.test)
    

提交回复
热议问题