From fc7bbe92230526b9c8c117d7add1d60b3e1ae0f3 Mon Sep 17 00:00:00 2001 From: JD Solanki Date: Fri, 18 Aug 2023 19:52:45 +0530 Subject: [PATCH] docs: improve custom component dirs example (#22697) --- docs/2.guide/2.directory-structure/1.components.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/2.guide/2.directory-structure/1.components.md b/docs/2.guide/2.directory-structure/1.components.md index 825cb82b34ff..89c7db94b288 100644 --- a/docs/2.guide/2.directory-structure/1.components.md +++ b/docs/2.guide/2.directory-structure/1.components.md @@ -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 => + { path: '~/calendar-module/components' }, + + // ~/user-module/components/account/UserDeleteDialog.vue => + { path: '~/user-module/components', pathPrefix: false }, + + // ~/components/special-components/Btn.vue => { 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 => + // ~/components/base/Btn.vue => '~/components' ] })