JavaShuo
栏目
标签
vue-cli项目中使用axios报错:TypeError: Cannot read property ‘protocol‘ of undefined
时间 2021-01-19
标签
vue
axios
vue.js
javascript
栏目
微服务
繁體版
原文
原文链接
vue项目中引入axios,请求数据报错 在main.js引入axios 在另一个文件中使用axios请求数据 这时候报错,报错信息请看截图 查了好多资料,说是要给axios定义个别名,在main.js中使用property原型添加 这时候可以请求到数据,但还是有报错信息 查了好多资料,各种测试,发现把main.js里面的:Vue.use(axios) 这句代码去掉,使用原型定义别名,直接使用别名
>>阅读原文<<
相关文章
1.
Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined
2.
react报错 TypeError: Cannot read property 'setState' of undefined
3.
× react报错:TypeError: Cannot read property ‘render‘ of undefined
4.
vue报错:"TypeError: Cannot read property 'forEach' of undefined"
5.
Vue.js报错—TypeError: Cannot read property 'Name' of undefined
6.
vue用axios时报错:Cannot read property 'protocol' of undefined!
7.
TypeError: Cannot read property 'compilation' of undefined
8.
"TypeError: Cannot read property ‘_wrapper’ of undefined"
9.
TypeError: Cannot read property 'key' of undefined
10.
TypeError Cannot read property ‘nativeElement’ of undefined
更多相关文章...
•
在Spring中使用Redis
-
Redis教程
•
Redis中使用Lua语言
-
Redis教程
•
Composer 安装与使用
•
C# 中 foreach 遍历的用法
相关标签/搜索
项目报错
typeerror
property
undefined
protocol
使用报告
read
vuecli
read%
项目实用
JavaScript
微服务
红包项目实战
PHP教程
Spring教程
应用
注册中心
0
分享到微博
分享到微信
分享到QQ
每日一句
每一个你不满意的现在,都有一个你没有努力的曾经。
最新文章
1.
python的安装和Hello,World编写
2.
重磅解读:K8s Cluster Autoscaler模块及对应华为云插件Deep Dive
3.
鸿蒙学习笔记2(永不断更)
4.
static关键字 和构造代码块
5.
JVM笔记
6.
无法启动 C/C++ 语言服务器。IntelliSense 功能将被禁用。错误: Missing binary at c:\Users\MSI-NB\.vscode\extensions\ms-vsc
7.
【Hive】Hive返回码状态含义
8.
Java树形结构递归(以时间换空间)和非递归(以空间换时间)
9.
数据预处理---缺失值
10.
都要2021年了,现代C++有什么值得我们学习的?
本站公众号
欢迎关注本站公众号,获取更多信息
相关文章
1.
Uncaught (in promise) TypeError: Cannot read property 'protocol' of undefined
2.
react报错 TypeError: Cannot read property 'setState' of undefined
3.
× react报错:TypeError: Cannot read property ‘render‘ of undefined
4.
vue报错:"TypeError: Cannot read property 'forEach' of undefined"
5.
Vue.js报错—TypeError: Cannot read property 'Name' of undefined
6.
vue用axios时报错:Cannot read property 'protocol' of undefined!
7.
TypeError: Cannot read property 'compilation' of undefined
8.
"TypeError: Cannot read property ‘_wrapper’ of undefined"
9.
TypeError: Cannot read property 'key' of undefined
10.
TypeError Cannot read property ‘nativeElement’ of undefined
>>更多相关文章<<