'Nuxtjs not grabbing query params
I have the following url: localhost:8080/account/reset-password?c=525448&g=usr&u=144c4c8e-5bf1-454f-a863-20c4ee149865 and am trying to grab the query parameters using Nuxtjs.
Within nuxt it seems like there is a $router object that can be used as const queryParams = this.$route.query but when I log out queryParams its an empty object.
I have also gone into the the browser console and tried
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
console.log(params) // returns Object { }
what am I doing wrong? I would expect there to be an object
{
c: 525448
g: usr
u: 144c4c8e-5bf1-454f-a863-20c4ee149865
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
