Vuex requires a Promise polyfill in this browser
2017-11-23 15:44
246 查看
在使用Vuex时,使用ie浏览器会出现“Vuex requires a Promise polyfill in this browser”的错误提示,这是因为使用了ES6 Promise,而IE浏览器不支持,解决方案如下:
1.安装babel-polyfill
2.引入babel-polyfill
在webpack.config.js中增加(如果使用的是vue-cli+vue webpack模板则在webpack.base.conf.js中增加):
3.使用babel-polyfill
将webpack.config.js(如果使用的是vue-cli+vue webpack模板则是webpack.base.conf.js)文件中的
修改为
完成
1.安装babel-polyfill
1 | npm install --save babel-polyfill |
在webpack.config.js中增加(如果使用的是vue-cli+vue webpack模板则在webpack.base.conf.js中增加):
12 | require("babel-polyfill"); //es5//import "babel-polyfill"; //es6 |
将webpack.config.js(如果使用的是vue-cli+vue webpack模板则是webpack.base.conf.js)文件中的
12345 | module.exports = { entry: { app: './src/main.js' }…… |
12345 | module.exports = { entry: { app: ['babel-polyfill', './src/main.js'] }…… |
相关文章推荐
- vuex requires a Promise polyfill in this browser
- IE报vuex requires a Promise polyfill in this browser问题解决
- VUE 报 Error: [vuex] vuex requires a Promise polyfill in this browser.
- Error: [vuex] vuex requires a Promise polyfill in this browser. 与 babel-polyfill 的问题
- vue.js之路(5)——解决vuex requires a Promise polyfill in this browser问题
- Vue-cli 在IE下[vuex] vuex requires a Promise polyfill in this browser.问题
- vuex requires a Promise polyfill in this browser
- IE浏览器报Promise未定义的错误、解决vuex requires a Promise polyfill in this browser问题
- IE报vuex requires a Promise polyfill in this browser问题解决
- 【vuex】【vue】【兼容】IE报vuex requires a Promise polyfill in this browser问题解决
- vue做的项目在ie11下一片空白:vue requires a Promise pllyfill in this browser
- 解决“requires a Promise polyfill in this browser”错误
- The goal you specified requires a project to execute but there is no POM in this directory
- QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
- java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection
- DosBox 报错 this program requires dosxnt.exe to be in your path
- java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection
- VUE 报这个错,在浏览器的 console 中报 uncaught (in promise)
- The goal you specified requires a project to execute but there is no POM in this directory 错误
- Sharepoint:The security validation for this page is invalid. Click Back in your Web browserSharepoin