3👍
✅
$nuxt
, precisely window.$nuxt
is only available on client-side and should only be used as escape hatch.
You can access the route object via this.$route
instead when using the Options API.
computed: {
updateActiveRoute() {
return this.$route.params.name ? this.$route.params.name : 'Hello'
}
},
watch: {
updateActiveRoute(newVal) {
this.activeRoute = newVal
}
}
Source:stackexchange.com