參考
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
检查到js
的Promise
时,transform-runtime
会将Promise
做转换,然后将其抛出为全局对象即可达到跟babel-polyfill
一样的效果。