How can I fetch query parameters in Vue.js?
E.g. http://somesite.com?test=yay.
http://somesite.com?test=yay
Can’t find a way to fetch or do I need to use pure JS or some library for this?
According to the docs of route object, you have access to a $route object from your components, which exposes what you need. In this case
$route
//from your component console.log(this.$route.query.test) // outputs 'yay'
1.4m articles
1.4m replys
5 comments
57.0k users