安装:在需要使用到的vue项目目录下,使用npm下载安装: npm/cnpm i element-ui -S/--save
<!-- 引入样式 --> <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> <!-- 引入组件库 --> <script src="https://unpkg.com/element-ui/lib/index.js"></script>
// 在main.js中引入ElementUI 完整引入 import ElementUI from ‘element-ui‘; import ‘element-ui/lib/theme-chalk/index.css‘; // import {Button,Row} from ‘element-ui‘;
然后将.babelrc文件内容修改为:为什么vue项目里没有static/babelrc文件夹??? 找不到
{ ? "presets":[["es2015",{"modules":false}]], ? "plugins":[ ? [ ? "component", ? { ? "libraryName":"element-ui", ? "styleLibraryName":"theme-chalk" ? } ? ] ? ] }
原文:https://www.cnblogs.com/677a/p/11726115.html