Access to XMLHttpRequest at 'file:///F:/vue/vue20200414/%E5%BD%92%E6%A1%A3/%E5%BD%92%E6%A1%A3/04%20day_vue/axios2.html' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

错误原因:函数方法,或者数据有问题,拷贝官方会减少出现

比如缺少斜杠、方法名使用错误

this.$axios.default.baseURL = 'http://127.0.0.1:8888';

 上面default需要改为defaults

有人baseURL 写成baseURI 

Logo

前往低代码交流专区

更多推荐