mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
docs: improve custom component dirs example (#22697)
This commit is contained in:
parent
4e538a03e2
commit
fc7bbe9223
@ -34,7 +34,20 @@ By default, only the `~/components` directory is scanned. If you want to add oth
|
|||||||
```ts [nuxt.config.ts]
|
```ts [nuxt.config.ts]
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
components: [
|
components: [
|
||||||
|
// ~/calendar-module/components/event/Update.vue => <EventUpdate />
|
||||||
|
{ path: '~/calendar-module/components' },
|
||||||
|
|
||||||
|
// ~/user-module/components/account/UserDeleteDialog.vue => <UserDeleteDialog />
|
||||||
|
{ path: '~/user-module/components', pathPrefix: false },
|
||||||
|
|
||||||
|
// ~/components/special-components/Btn.vue => <SpecialBtn />
|
||||||
{ path: '~/components/special-components', prefix: 'Special' },
|
{ path: '~/components/special-components', prefix: 'Special' },
|
||||||
|
|
||||||
|
// It's important that this comes last if you have overrides you wish to apply
|
||||||
|
// to sub-directories of `~/components`.
|
||||||
|
//
|
||||||
|
// ~/components/Btn.vue => <Btn />
|
||||||
|
// ~/components/base/Btn.vue => <BaseBtn />
|
||||||
'~/components'
|
'~/components'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user