Vue项目跑在IE中报错:vuex requires a Promise polyfill in this browser.
因为使用了ES6 Promise,而IE浏览器不支持
解决方案:引入babel-polyfill包
npm install --save-dev babel-polyfill
在build/webpack.base.conf.js中
module.exports = {
context: path.resolve(__dirname, '../'),
entry: {
app: [
'babel-polyfill', //新增-----------------
'./src/main.js'
]
},
}

本文介绍了解决Vue项目在IE浏览器中运行时出现的vuex requires a Promise polyfill in this browser错误的方法。通过引入babel-polyfill包并配置webpack,可以确保项目在不支持ES6 Promise的IE中正常运行。

被折叠的 条评论
为什么被折叠?



