kat*_*kat 2 backwards-compatibility internet-explorer-10 internet-explorer-11 vuejs2
I hope this question/answer saves time for those having the same cross-compatibility issues with internet explorer.
Run Code Online (Sandbox Code Playgroud)
问题:我在我的一个项目中使用了vuejs2,结果发现早期版本的Internet Explorer存在一些兼容性问题.
起初,它归结为这个错误:
SCRIPT1014:无效字符
然后这一个:
'承诺'未定义
第一个错误是指使用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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5094 次 |
| 最近记录: |