add config item
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
import type {
|
||||
NuxtPage
|
||||
} from 'nuxt/schema'
|
||||
|
||||
export default defineNuxtConfig({
|
||||
devtools: { enabled: true },
|
||||
@ -10,10 +13,27 @@ export default defineNuxtConfig({
|
||||
},
|
||||
vite: {
|
||||
server: {
|
||||
cors: {
|
||||
cors: {
|
||||
origin: true,
|
||||
optionsSuccessStatus: 204,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
// hooks: {
|
||||
// 'pages:extend'(pages) {
|
||||
// function setMiddleware(pages: NuxtPage[]) {
|
||||
// for (const page of pages) {
|
||||
// if (/* some condition */ true) {
|
||||
// page.meta ||= {}
|
||||
// // Note that this will override any middleware set in `definePageMeta` in the page
|
||||
// page.meta.middleware = ['auth']
|
||||
// }
|
||||
// if (page.children) {
|
||||
// setMiddleware(page.children)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// setMiddleware(pages)
|
||||
// }
|
||||
// }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user