If I had a ./components/ui/global/ directory how would I automatically load that?
The documentation tells me that:
You can also selectively register some components globally by placing them in a
~/components/globaldirectory.
Theglobaloption can also be set per component directory.
https://nuxt.com/docs/guide/directory-structure/components
file: ./nuxt.config.ts
export default defineNuxtConfig({
//...
components: {
global: true,
dirs: ['~/components/ui/']
},
//...
});
In the current state it does not find my ./components/ui/global/ThePage.vue component
[Vue warn]: Failed to resolve component: the-page
I thought perhaps it might be something along these lines but couldn't get it to work
export default defineNuxtConfig({
//...
components: {
global: true,
dirs: [{
global: true,
'~/components/ui/'
}]
},
//...
});