In this tutorial, we are going to learn how we can get the query parameter from URL.
let's look into the sample example.
http://360learntocode.com?username=testUsing Vue Router:
Here, we want to get the username query parameter. In Vue.js there is an elegant way to get query parameters. If we are using the router then we can get the parameter inside the vue.js component as below.
let username =  this.$route.query.usernameWhich gives the username value. Another way to get parameters with the router is
let username = this.$route.params.usernameUsing Javascript URLSearchParams :
We can use URLSearchParams() method which helps to work with the query string of the URL. We can use this inside our vue.js component methods as below.
Or
