ViewUI
ViewUI copied to clipboard
[Bug Report]当Select在按需引入的情况下,v-click-outside-x中的代码未被babel转为ES5代码导致不兼容
Environment Windows 10 ;默认Edge浏览器Microsoft Edge 44.18362.387.0
Reproduction link 无链接
Steps to reproduce 1.使用babel-plugin-import按需引入的时候, 2.在入口文件main.js中使用Vue.component('Select', Select)
What is expected? 按需引入的情况下 Vue.component('Select', Select)能够兼容浏览器转换代码
What is actually happening? Edge浏览器报错Expected identifier, string or number 发现是v-click-outside-x.js中的let,const,扩展运算符(...)等ES6代码没有被转换,导致的浏览器报错。 view-design/src/locale/format.js文件中的代码也没有被转换。 原来的3.5.1没有这个问题。
目前已找到解决方法。 原iview仓库issue#2747。 不知道什么原因,处理这个问题的pull#5283被关闭。
vue-cli3的配置方法 在vue.config.js中配置代码如下:
chainWebpack: config => {
config.module
.rule('view-design')
.test(/view-design.src.*?js$/)
.use('babel')
.loader('babel-loader')
.end()
return config
}
ps:官网的View UI和Admin Pro在低版本chrome(测的是47版本的)中也是存在同样的问题,官网应该是全量引入所以不存在该问题。
nuxt 下面配置没有效果呀