If you're using the module Vue Router, the following answer might be helpful to you: https://stackoverflow.com/a/35916241/23561820
Summary (with Vue Router)
With the usage of the route object, a query in the URL can be retrieved as such:
URL
http://somesite.com?test=yay
Code
const test = this.$route.query.test; console.log(test); // outputs 'yay'
If you'd prefer not to use the library Vue Router, you may find the answer below useful: https://stackoverflow.com/a/901144/23561820
Summary (without Vue Router)
Using URLSearchParams, a query in the URL can be acquired like so:
URL
http://somesite.com?test=yay
Code
const urlParams = new URLSearchParams(window.location.search); const test = urlParams.get('test'); console.log(test); // outputs 'yay'