How I can set middleware for page in router.js file? Now I'm using property in component:
export default {
middleware: 'auth'
}
What I want to do:
{
path: '/',
name: 'home',
component: page('home.vue'),
middleware: 'auth' // or something like that
}
P.S. page() imports me all of the components from /pages folder (don't worry about it). Thanks a lot in advance.
question from:
https://stackoverflow.com/questions/65938177/nuxt-js-how-set-middleware-in-router-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…