A: I'm not sure if there are special caveats for query params in Vue Router, as I've used it once and it was like a year ago in a Udemy course section, but the typical query param usage is wrong it your case. It should be :
'/home/video?usertype=usertypehere'
B: You can use the URLSearchParams interface inside a computed property :
userType() {
// You can also define this in a data property inside the mounted lifecycle hook if you need to reuse it elsewhere
let searchParams = new URLSearchParams(window.location.search);
return searchParams.get('usertype');
},
So I checked out Vue Router's documentation real quick, and for query params, you can use the following syntax (to pass query params to your defined route).