【整理收集】使用当中IE浏览器遇到的兼容性问题

(所测试的IE浏览器  版本是ie11,其它的是使用IE控制台自带的切换IE10,IE9来测试出来的结果)

1、new Date() 时间兼容性问题,IE只识别   “2019/08/01 17:58:54” 斜杠格式,.getTime()才能正常转换成时间戳。‘-’这种的会返回NaN,其他浏览器‘/’或者‘-’都能正常运行。

2、IE浏览器不支持ES6语法(需要使用babel-polyfill来转换)。

3、input属性placeholder(IE9不支持)

4、get请求在ie浏览器会被强制缓存(目前处理方法是加个时间戳参数)

5、请求中带中文ie浏览器会不识别(必须转码)其它主流浏览器会自动转码

6、用window.open(url)下载文件,如果url中包含中文不能下载文件

7、element的大文本type="textarea"时rows属性在IE下不生效

8、IE10,IE9下element里的el-upload同一个文件上传后在删除后无法上传同一个文件,

  解决方法:使用如下解决(ie10只能用父节点是form来重置)

  参考:https://blog.csdn.net/li_yunsong/article/details/104015953?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-4.channel_param

<el-upload class="upload-demo-ie-junk">
  <el-button ref='upRef' type="success" size="mini" icon="el-icon-s-promotion">点击上传</el-button>
  <el-button @click="clearFile('upRef', this.$refs)">删除</el-button>
</el-upload>
// 删除方法
clearFile(refsValue, refs) {
 const refsData = refs[refsValue]
 // 如果页面中定义了多个ref,this.$refs是个数组
 const dom = Array.isArray(refsData) ? refs[refsValue][0].$el : refs[refsValue].$el
 const ojbFile = dom.getElementsByClassName('el-upload__input')[0]
 if (ojbFile) {
   const form = document.createElement('form')
   const beforInput = ojbFile.nextSibling
   const parentInput = ojbFile.parentNode
   form.appendChild(ojbFile)
   form.reset()
   parentInput.insertBefore(ojbFile, beforInput)
 }
}

9、el-dialog组件设置center属性后在ie浏览器中里面的form表单会继承居中属性引起样式错乱(我的解决方案是给这个弹框单独重写了样式,不知道还有没有其他更好的实现方法)

10、可在IE9,10,11正常使用的富文本,有大佬根据百度的ueditor弄了一个npm包,安装vue-ueditor-wrap即可,具体使用可以自行百度一下或者参考https://blog.csdn.net/qq_40180411/article/details/100149621

未完待续

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

天才和人才就差了二

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值