安装
一个快速教程,介绍如何安装软件包以及支持的插件。
安装软件包
npm add reka-ui
pnpm add reka-ui
yarn add reka-ui
bun add reka-ui
Nuxt 模块
Reka UI 提供 Nuxt 模块支持。
在 nuxt.config.ts 中,只需将 reka-ui/nuxt 添加到 modules 中,它将为您自动导入所有组件。
nuxt.config.ts
export default defineNuxtConfig({
modules: ['reka-ui/nuxt'],
})
unplugin-vue-components
Reka UI 还为流行的 unplugin-vue-components 提供了解析器。
在 vite.config.ts 中,导入 reka-ui/resolver,并按如下方式配置,它将自动导入 Reka UI 中的所有组件。
vite.config.ts
import Components from 'unplugin-vue-components/vite'
import RekaResolver from 'reka-ui/resolver'
export default defineConfig({
plugins: [
vue(),
Components({
dts: true,
resolvers: [
RekaResolver()
// RekaResolver({
// prefix: '' // use the prefix option to add Prefix to the imported components
// })
],
}),
],
})