Skip to content

Commit

Permalink
docs: improve custom component dirs example (#22697)
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Aug 18, 2023
1 parent 4e538a0 commit fc7bbe9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/2.guide/2.directory-structure/1.components.md
Expand Up @@ -34,7 +34,20 @@ By default, only the `~/components` directory is scanned. If you want to add oth
```ts [nuxt.config.ts]
export default defineNuxtConfig({
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' },

// 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'
]
})
Expand Down

0 comments on commit fc7bbe9

Please sign in to comment.