您现在的位置:首页 >> 前端 >> 内容

IE报vuex requires a Promise polyfill in this browser错误问题解决方法

时间:2017/10/14 10:08:00 点击:

  核心提示:IE报vuex requires a Promise polyfill in this browser错误问题解决方法使用Vuex, IE浏览器报错因为使用了 ES6 中用来传递异步消息的的Promi...

IE报vuex requires a Promise polyfill in this browser错误问题解决方法

使用Vuex, IE浏览器报错

IE报vuex requires a Promise polyfill in this browser错误问题解决方法

因为使用了 ES6 中用来传递异步消息的的Promise,而IE低版本的浏览器不支持。

IE报vuex requires a Promise polyfill in this browser错误问题解决方法

解决方法

安装 babel-polyfill 。 babel-polyfill可以模拟ES6使用的环境,可以使用ES6的所有新方法

npm install --save babel-polyfill

修改Webpack/Browserify/Node配置

在webpack.config.js文件中,使用

module.exports = {
  entry: {
    app: ["babel-polyfill", "./src/main.js"]
  }
};

参考文档

1:使用ES6的浏览器兼容性问题

2: vuex requires a Promise polyfill in this browser

Tags:IE E报 报V VU 
作者:网络 来源:tc216的博客