解決axios ie 下 缺少promise 墊片

參考

https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md#es6-promise-polyfill

https://stackoverflow.com/questions/35769777/axios-ie-promise-doesnt-work

https://sharepoint.stackexchange.com/questions/249711/axios-sharepoint-error-in-ie-11-but-not-chrome

也可以

// 将Promise抛出为全局对象

window.Promise = Promise

原理:当babel检查到jsPromise时,transform-runtime会将Promise做转换,然后将其抛出为全局对象即可达到跟babel-polyfill一样的效果。

发布了91 篇原创文章 · 获赞 76 · 访问量 44万+

猜你喜欢

转载自blog.csdn.net/u013291076/article/details/93043329
今日推荐