refactor(docs): rewrite intro to the components utils

This commit is contained in:
Andrey 2023-08-16 15:41:55 +03:00
parent ace3c30145
commit c7c136df92
1 changed files with 1 additions and 1 deletions

View File

@ -826,7 +826,7 @@ export default defineNuxtModule({
[source code](https://github.com/nuxt/nuxt/blob/main/packages/kit/src/components.ts)
Nuxt 3, by default, imports components located in the `components` directory. But there might be occasions when you wish to source components from a different directory or prefer to import them only on-demand. To cater to these needs, Nuxt 3 introduces the `addComponentsDir` and `addComponent` functionalities. These tools enable you to tailor the components configuration according to your requirements.
In Nuxt, components from the components directory are automatically imported by default. However, if you need to import components from an alternative directory or wish to selectively import them as needed, `@nuxt/kit` provides the `addComponentsDir` and `addComponent` methods. These utils allow you to customize the component configuration to better suit your needs.
### `addComponentsDir`