下载 element-plus

快速搭建·

​https://github.com/element-plus/element-plus-vite-starter​

vue create elem-app

 

element-plus 安装_css

 

 

 

 回车选vue3

 

 

element-plus 安装_Vue_02

 之后一路回车

cd 到app目录

vue add element-plus

选 fully import

element-plus 安装_css_03

 

 

 前面应该遇到过,这里注意(y/N) 大写N意思是回车时默认选N

element-plus 安装_App_04

 

 选zh-ch

element-plus 安装_Vue_05

 完成

运行

npm run serve

 

 

TS安装

创建时勾选ts

修改main.ts文件, /plugins/element.js不需要用了

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
//import installElementPlus from './plugins/element.js'

import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
import locale from 'element-plus/lib/locale/lang/zh-cn'
const app = createApp(App)
//installElementPlus(app)
app.use(ElementPlus, { locale }).use(store).use(router).mount('#app')