错误:  [vuex] vuex requires a Promise polyfill in this browser.

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

解决方法: 

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

npm install --save babel-polyfill

第二步(有三种方法):

方法1.require("babel-polyfill");

方法2.import "babel-polyfill";

方法3.在 Webpack/Browserify/Node中使用

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

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

替换

module.exports = {
  entry: {
    app:  './src/main.js'
  }
}

参考文档:http://www.cnblogs.com/princesong/p/6728250.html

参考文档:http://www.cnblogs.com/weiqinl/p/6794612.html

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2021-05-25
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-04-09
  • 2021-06-26
猜你喜欢
  • 2021-06-16
  • 2022-02-12
  • 2022-12-23
  • 2021-04-29
  • 2021-12-27
  • 2021-08-16
相关资源
相似解决方案