Laravel+IE+Axios提示Promise未定义

使用axios异步获取数据,代码如下
axios.get('/ajax/load', {params: {filter: this.currentFilter, start_time: this.startTime, end_time: this.endTime}}).then(response => response.data).then((res) => {
console.log(res.data);
});

chrome中正常,IE下提示错误{description: "“Promise”未定义", message: "“Promise”未定义", name: "ReferenceEr...", number: -2146823279, stack: "ReferenceEr..."}

安装es6-promise可解决问题:
运行命令npm install es6-promise
之后在resources/js/bootstrap.js文件中添加如下代码, 重新编译后IE下正常。
try {
window.Promise = require('es6-promise').Promise;
} catch (e) {}

点赞