Nuxt/examples/module-extend-pages/modules/pages/index.ts

16 lines
331 B
TypeScript
Raw Normal View History

import { defineNuxtModule, extendPages } from '@nuxt/kit'
import { resolve } from 'pathe'
export default defineNuxtModule({
setup () {
extendPages((pages) => {
// Add /test page
pages.push({
name: 'Test',
path: '/test',
file: resolve(__dirname, './pages/test.vue')
})
})
}
})