Skip to content
On this page

Nuxt Module

This module enables auto imports of components, composables and installs plugins and directives

INFO

Module compatible with Nuxt v3 or later

Installation

@zadigetvoltaire/ui
bash
npm install @zadigetvoltaire/ui
# or yarn add @zadigetvoltaire/ui
# or pnpm add @zadigetvoltaire/ui

Add it to your Nuxt modules:

ts
export default defineNuxtConfig({
  ...
  modules: ['@zadigetvoltaire/ui/nuxt'],
  zvUi: {
    injectToaster: true,
  },
  ...
})

Basic usage

vue
<template>
  <ZvButton>
    Button auto-imported
  </ZvButton>
</template>

<script lang="ts" setup>
  const toast = useToast()

  toast.show('Success message')
</script>

Module Options

ts
export interface ModuleOptions {
  /**
   * Install the toaster plugin and enable auto import of toaster composable
   */
  injectToaster?: boolean
  /**
   * Enable auto import of useCurrency composable
   */
  injectUseCurrency?: boolean
  /**
   * Enable auto import of useTheme composable
   */
  injectUseTheme?: boolean
  /**
   * install global of v-fullscreen-img directive
   */
  installFullscreenImgDirective?: boolean
  /**
   * Enable auto import of all components
   * @default true
   */
  injectComponents?: boolean
  /**
   * Enable Nuxt Devtools integration
   * @default true
   */
  devtools?: boolean
}