(所测试的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来重置)
<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
未完待续