- npm install element-plus --save
下载element-plus
2.npm install -D unplugin-vue-components unplugin-auto-import
导入方式:自动导入 不需要安装插件
3.配置文件
将:
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import {ElementPlusResolver } from 'unplugin-vue-components/resolvers'
插如到vite.config.ts中
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()]
})
4.验证是否导入
将按钮代码随意插入任意界面
Primary
Success
info