I understand that in the routes directly we can no longer use things like alias
and meta
. However I would still like to define some properties for may pages.
For instance say my pages have some specific privilege required and redirect or do nothing accordingly.
I know I can write some simple middleware to check this:
export default function (context, route, redirect) {
// check auth
return;
}
I need some place to set an "auth" property that could have many values, object, array, etc.
Not sure how to set up the .vue
files so that the middleware can get access to them.
Also it seems the middleware doesn't run on first load? How does this work with restricted routes?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1074">#c1074</a>)</em></sub></div>