浏览器报错:vuex requires a Promise polyfill in this browser的解决

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

npm install --save babel-polyfill

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

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

替换

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

猜你喜欢

转载自blog.csdn.net/newjueqi/article/details/80237484