浏览器兼容 IE11 “ReferenceError: “Promise”未定义"” “ReferenceError: “Promise”未定义"”
“ReferenceError: “Promise”未定义"”
IE不支持promise解决办法
//引入
<script src = "https://cdn.polyfill.io/v2/polyfill.min.js"> </script>
//或
<script type="text/javascript" src ="https://cdn.polyfill.io/v2/polyfill.min.js?features=es6"></script>
promise对iE都不支持
VUE项目
(1)cnpm install --save babel-polyfill
(2)在webpack.base.conf.js添加代码 require("babel-polyfill")
(3)在main.js里面添加代码 import "babel-polyfill";
React项目
(1)cnpm install --save babel-polyfill
(2)在入口文件(app.js/router.js)里面添加代码 import "babel-polyfill";