I know this was asked a couple of times, but I do not understand something about watching for a route change in Nuxt2.
It doesn't work for me.
My code is:
watch: {
$route(to, from) {
console.log('route change to', to)
console.log('route change from', from)
},
},
Minimal reproducable example:
https://codesandbox.io/s/dreamy-feather-90gbjm
Expected behavior
show console logs on route change.
result
nothing happens