element-ui实现部分引用

时间:2020-05-11 19:56:31   收藏:0   阅读:96

1.首先安装 babel-plugin-component组件:

技术分享图片

2.修改babel.js配置

 1 module.exports = {
 2   presets: [
 3     ‘@vue/app‘,
 4     [‘env‘,   //添加 babel-preset-env 配置 
 5       {
 6         ‘modules‘: false
 7       }
 8     ]
 9   ],
10   plugins: [      
11     [
12       ‘component‘,
13       {
14         ‘libraryName‘: ‘element-ui‘,
15         ‘styleLibraryName‘: ‘theme-chalk‘
16       }
17     ]
18   ]
19 }

3.main.js里配置

技术分享图片

原文:https://www.cnblogs.com/guwufeiyang/p/12870574.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!