You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, components are created in the runtime/components dir.
We can inject auto-importable components (only what users need) like so:
import{defineNuxtModule,addComponent}from'@nuxt/kit'exportdefaultdefineNuxtModule({setup(options,nuxt){constresolver=createResolver(import.meta.url)// From the runtime directoryaddComponent({name: 'MySuperComponent',// name of the component to be used in vue templatesexport: 'MySuperComponent',// (optional) if the component is a named (rather than default) exportfilePath: resolver.resolve('runtime/components/MySuperComponent.vue')})// From a libraryaddComponent({name: 'MyAwesomeComponent',// name of the component to be used in vue templatesexport: 'MyAwesomeComponent',// (optional) if the component is a named (rather than default) exportfilePath: '@vue/awesome-components'})}})
The text was updated successfully, but these errors were encountered:
Firstly, components are created in the
runtime/components
dir.We can inject auto-importable components (only what users need) like so:
The text was updated successfully, but these errors were encountered: