Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
404 views
in Technique[技术] by (71.8m points)

vue.js - Nuxt.js: How set middleware in router.js

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...