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

时间:2017-10-13 16:01:00

标签: 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:无效字符

然后是这个:

  

'无极'未定义

1 个答案:

答案 0 :(得分:6)

第一个错误是指使用Ecmascript6 back thicks(`)简化了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>