コンテンツにスキップする

インストール

パッケージのインストールに関する簡単なチュートリアルと、サポートされるプラグインを紹介します。

パッケージのインストール

NPM Downloads

sh
$ npm add radix-vue

Nuxt モジュール

Radix Vue は Nuxt モジュールをサポートしています。

nuxt.config.ts で、radix-vue/nuxt をモジュールに追加するだけで、すべてのコンポーネントが自動的にインポートされます。

ts
export default defineNuxtConfig({
  modules: ['radix-vue/nuxt'],
})

unplugin-vue-components

Radix Vueには人気のunplugin-vue-componentsの解決プログラムもあります。

vite.config.tsで、radix-vue/resolverをインポートし、次のように構成すると、Radix Vueからすべてのコンポーネントが自動インポートされます。

ts
import Components from 'unplugin-vue-components/vite'
import RadixVueResolver from 'radix-vue/resolver'

export default defineConfig({
  plugins: [
    vue(),
    Components({
      dts: true,
      resolvers: [
        RadixVueResolver()

        // RadixVueResolver({
        //   prefix: '' // use the prefix option to add Prefix to the imported components
        // })
      ],
    }),
  ],
})