1,安装element-ui

npm i element-ui -S

2,在min.js中写入以下配置

1 import ElementUI from 'element-ui';
2 import 'element-ui/lib/theme-chalk/index.css';
3 
4 Vue.use(ElementUI);

3.

npm install babel-plugin-component -D

4.将.babelrc文件修改为以下

 1 {
 2   "presets": [["es2015", { "modules": false }]],
 3   "plugins": [
 4     [
 5       "component",
 6       {
 7         "libraryName": "element-ui",
 8         "styleLibraryName": "theme-chalk"
 9       }
10     ]
11   ]
12 }