element-plus 版本升级由@1.1.0-beta.15 升级到@2.0.4 版本时,在开发时遇到的问题整理及解决方法
一、错误: Can't reexport the named export 'xxx' from non EcmaScript module (only default export is available)
处理
这个问题是 element plus 版本升级后,再运行项目,element plus 对 webpack 的一个编译处理。
解决方式:
在 vue.config.js 的 chainWebpack 下增加一个规则:
1 |
|
二、样式错误问题:input的白/蓝边、图片的灰色底
在做用户登录发现的el-input 存在的2个样式问题
1 |
|
三、tbody路径的变更
1.x版本的element plus获取el元素的方式为:
1 |
|
2.x版本的element plus获取el元素的方式为
1 |
|
四、中台项目侧边栏收起图标不显示问题
查看控制台发现,#app .sidebar-container .svg-icon{margin-left:16px} 这个样式存在问题
解决方式:在侧边栏menu收起时,取消margin-left
1 |
|