Having a problem trying to access query params.
I can access the query via
this.$attrs.query
or this.$route.query.propValue
In the chrome debugger.
When I try to load it I get the one of these errors:
vue.runtime.esm.js?2b0e:4484 Uncaught TypeError: Cannot read property '$attrs' of undefined
vue.runtime.esm.js?2b0e:4484 Uncaught TypeError: Cannot read property '$route' of undefined
Examples of where I am using it in the component:
props: {
propValue: {
type: String,
default: () => {
console.log('default')
return this.$route.query.propValue // this.$attrs.query //
}
}
},
methods: {
async update() {
const res = await axios.post('/api/endpoint', {
valueToSend: this.propValue...