- 安装element-ui
cnpm install element-ui --save
- 在main.js文件当中进行配置
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
npm run serve
启动项目
遇到报错:
R babel-runtime/helpers/extends in ./node_modules/_async-validator@1.8.5@async-validator/es/index.js
R babel-runtime/helpers/typeof in ./node_modules/_async-validaton1.8.5@iasync-validator/es/index.js,./node_moduls/_async-validator@1.8.5@async-validator/es/rule/type.js and 1 other
o install them,you can run: npm install --save babel-runtime/helpers/extends babel-runtime/helpers/typeof
解决办法:重新安装
cnpm uninstall element-ui --save
cnpm install element-ui --save
ps:这里在网上找了很多种方法都没用,没想到最后重新安装就可以了
贴一个链接,说不定有帮助:
https://segmentfault.com/q/1010000020918347