Vue2全局引入
npm i element-ui -S
//在main.js中添加
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue2按需引入
npm i element-ui -S
//在main.js中添加
import 'element-ui/lib/theme-chalk/index.css';
import {Button} from 'element-ui';
Vue.use(Button);
Vue3
vue3全局引入
npm install element-plus --save
//在main.js中添加
import ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import locale from 'element-plus/lib/locale/lang/zh-cn'
createApp(App).use(ElementPlus, { locale }).mount("#app");