为什么会提示Promise is not defined
你需要Promise的polyfill。
在官方文档的https://github.com/mzabriskie...
提到了
ES6 Promise Polyfill
Up until the 0.6.0 release ES6 Promise was being polyfilled using
es6-promise. With this release, the polyfill has been removed, and you
will need to supply it yourself if your environment needs it.
require('es6-promise').polyfill();
var axios = require('axios');
在babel下我想你需要
npm install --save-dev babel-polyfill
具体用法取决你是否使用打包工具可以参考babel文档
http://babeljs.io/docs/usage/...
10 回答10.8k 阅读
7 回答11k 阅读
6 回答2.7k 阅读
5 回答4.5k 阅读✓ 已解决
4 回答2.8k 阅读✓ 已解决
2 回答2.3k 阅读✓ 已解决
2 回答4.8k 阅读✓ 已解决
下载这个js加载就行 https://raw.githubusercontent...