Setting up PrimeVue in a Nuxt project.
PrimeVue is available for download on npm registry along with the official @primevue/nuxt-module.
In nuxt.config file, add the @primevue/nuxt-module to the modules section and define primevue object for the configuration of the module.
Configure the module to use a theme like Aura.
Provide your PrimeUI license key through the public runtime config so the Nuxt module can pass it to PrimeVue. The key may also be supplied with the NUXT_PUBLIC_PRIMEUI_LICENSE environment variable, in which case no change to nuxt.config is required.
The nuxt-primevue module registers the components automatically with tree-shaking support so you may start using them instantly.
The module installs the PrimeVue plugin by default. Disable this option if you prefer to configure PrimeVue manually e.g. with a Nuxt plugin.
Main configuration settings of PrimeVue, refer to the configuration documentation for details.
The auto import feature registers components automatically with tree shaking support. Defaults to true, when disabled use include/exclude options of components and directives for manual registration.
Use the prefix in components and directives to add a prefix for registration.
Configures the global pass through import path.
mycustompt.js file defines the configuration and exports it.
Configures the theme configuration path for the customizations of a theme in styled mode.
The mytheme.js file contains the theme configuration.
When autoImport is disabled, use the include and exclude for manual registration.
The components to import and register are defined with the include option using a string array. When the value is ignored or set using the * alias, all of the components are registered.
In case all components are imported, particular components can still be excluded with the exclude option.
By default, for compatibility reasons, Chart and Editor components are excluded. To include them simply set the exclude option to an empty list.
Use the prefix option to give a prefix to the registered component names.
Component registration can be customized further by implementing the name function that gets an object representing the import metadata. name is the label of the component, as is the default export name and from is the import path.
When autoImport is disabled, use the include and exclude for manual registration.
The names of the directives to import and register are provided using the include property. When the value is ignored or set using the * alias, all of the directives are registered.
Similar to components, certain directives can be excluded and name registration can be customized.
Determines the composables to use, when default value is ignored or set as * all composables are imported.
Nuxt based samples with different options are available at PrimeVue examples repository.
Welcome to the Prime UI Ecosystem! Once you have PrimeVue up and running, we recommend exploring the following resources to gain a deeper understanding of the library.