element-ui & babel-plugin-component config bug

vue-cli

bad

babel.config.js

module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
[
"es2015",
{
"modules": false,
},
],
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk",
},
],
],
};

good

babel.config.js

module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk",
},
],
],
};

main.js


import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store'; // import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
// Vue.use(ElementUI); import { Button, Select } from 'element-ui';
// Vue.component(Button.name, Button);
// Vue.component(Select.name, Select);
/* OR */
Vue.use(Button);
Vue.use(Select); Vue.config.productionTip = false; new Vue({
router,
store,
render: h => h(App),
}).$mount('#app');

https://element.eleme.io/#/en-US/component/quickstart#on-demand

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. Oracle介绍(初学者必须知道的)
  2. JAVA通过HTTP访问:Post+Get方式(转)
  3. java socket知识点
  4. quickstack is a tool to take call stack
  5. 小谈一下Java I/O
  6. java Spring 在WEB应用中的实例化
  7. 男装电商Bonobos融资5500万美元,计划IPO,全靠体验店战略 - 国外 - 快鲤鱼
  8. [转载]STL map中的一些基本函数
  9. 我觉得主要靠积累,难度不是问题,主要靠时间积累,以及兴趣带来的学习能力(我觉得至少5年全职Qt开发经验,才能算精通)
  10. MySQL迁移方案(后续再补充)
  11. BZOJ 3211: 花神游历各国【线段树区间开方问题】
  12. Node.js ZLIB
  13. C# Linq GroupBy 分组过滤求和
  14. MATLAB 通过对话框返回值选择下一步操作
  15. 日幣匯率 ( Node-Red 爬蟲 )
  16. task_payment_byonlinedown
  17. [bcc32 Error] ws2def.h(231): E2238 Multiple declaration for 'sockaddr'
  18. Hadoop源码阅读-HDFS-day1
  19. System.exit(0)会跳过finally块的执行
  20. it 删除远程分支

热门文章

  1. Devexpress DockManager多页面浮动窗口会关闭所有页面的问题
  2. Git提交代码规范 而且规范的Git提交历史,还可以直接生成项目发版的CHANGELOG(semantic-release)
  3. Linux常用命令:文件操作命令
  4. 20201104gryz模拟赛解题报告
  5. codevs1700 施工方案第二季
  6. Java8新特性_四大内置核心函数式接口
  7. Spark高级数据分析——纽约出租车轨迹的空间和时间数据分析
  8. 存储过程demo返回银行名称
  9. Codeforces Round #677 (Div. 3) G. Reducing Delivery Cost(dijkstra算法)
  10. Testing Beta Round (Unrated)