mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
32 lines
734 B
TypeScript
32 lines
734 B
TypeScript
import { createResolver, defineNuxtModule, useNuxt } from 'nuxt/kit'
|
|
|
|
export default defineNuxtModule({
|
|
meta: {
|
|
name: 'page-extend',
|
|
},
|
|
setup () {
|
|
const nuxt = useNuxt()
|
|
const resolver = createResolver(import.meta.url)
|
|
|
|
nuxt.hook('pages:extend', (pages) => {
|
|
pages.push({
|
|
name: 'page-extend',
|
|
path: '/page-extend',
|
|
file: resolver.resolve('../runtime/page.vue'),
|
|
}, {
|
|
path: '/big-page-1',
|
|
file: resolver.resolve('./pages/big-page.vue'),
|
|
meta: {
|
|
layout: false,
|
|
},
|
|
}, {
|
|
path: '/big-page-2',
|
|
file: resolver.resolve('./pages/big-page.vue'),
|
|
meta: {
|
|
layout: false,
|
|
},
|
|
})
|
|
})
|
|
},
|
|
})
|