Nuxt/examples/module-extend-pages/modules/pages/index.ts
Daniel Roe 95cbe67f99
feat(kit, nuxt3): add pages:extend and extendPages (#1740)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
Co-authored-by: fgiraud <hello@florent.dev>
2021-11-09 11:16:23 +01:00

16 lines
331 B
TypeScript

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')
})
})
}
})