Nuxt/examples/advanced/module-extend-pages/modules/pages/index.ts
Clément Ollivier 1a7b570c82
docs(examples): add examples to docs (#3966)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2022-03-30 17:59:28 +02: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')
})
})
}
})