摘录网址:http://www.cnblogs.com/weiqinl/p/6794612.html

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"]
  }
};

替换

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

参考文档:

1:使用ES6的浏览器兼容性问题。 https://segmentfault.com/a/1190000005128101

2: vuex requires a Promise polyfill in this browser http://www.jianshu.com/p/3e3b171179f8

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
猜你喜欢
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2021-06-20
相关资源
相似解决方案