vuejs2 - Vuejs Internet Explorer 兼容性问题(版本 10 和 11)

标签 vuejs2 internet-explorer-11 internet-explorer-10 backwards-compatibility

I hope this question/answer saves time for those having the same cross-compatibility issues with internet explorer.

问题: 我在我的一个项目中使用了 vuejs2,结果发现在早期版本的 Internet Explorer 中存在一些兼容性问题。

起初,它归结为这个错误:

SCRIPT1014: Invalid character

然后是这个:

'Promise' is undefined

最佳答案

第一个错误是指使用 Ecmascript6 后加号 (`) 简化了 javascript 中字符串的使用。 解决方案是使用连接 HTML 的旧方法。

关于第二个错误,早期版本的internet explorer没有处理promises的使用,解决方法是使用polyfill(这是一个确保向后兼容旧浏览器的api,例如:promises)

in my case I used this: 
<script src='https://cdn.polyfill.io/v2/polyfill.min.js'></script>

关于vuejs2 - Vuejs Internet Explorer 兼容性问题(版本 10 和 11),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46733830/

相关文章:

javascript - 使用 Javascript/Vue.Js 合并数组内的数组

javascript - Array.map() "syntax Error"in IE11,映射多个JSON Object字段

html - flex 属性在 IE 中不起作用

javascript - IE 9 和 10 产生意外和不一致的 MediaError

css - 为什么我的 wordpress 页面的 CSS 在 IE 中不能正常工作,但是当应用于非 wordpress 静态页面时在 IE 中工作正常?

javascript - vue ajax响应成功后如何显示模态?

javascript - 如何在vue中使用动态本地镜像?

javascript - 数据变化随机更新 - Vue/Vuex

html - 将多个元素与父元素的底部对齐

html - IE10 不支持空白 : pre-wrap?