Nuxt/Vue based app receives in watch:$route as well as in this.$route name, path, but never meta. E.g. I have a page Foo with
export default {
...
head(){
return{
title: 'Foo'
}
},
meta: {
title: 'Foo'
}
}
In the layout
export default {
created() {
console.log( this.$route );
}
watch:{
$route ({ path, name, meta }){
console.log( meta );
}
}
}
Yet, it's available in middleware
export default function ({ store, route }) {
console.log( route );
}
I can populate store from middleware and rely on it in the app, but it's doesn't look as a good solution to me.
Is there any decent way to receive page (route) meta with Router events? Actually what I need is page title on internal (SPA) navigation events.
title: this.$route.meta.title
work – larrykkk