1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > vue发送请求时遇到index.vue6ced90 Uncaught (in promise) TypeError Cannot read properties of undefined

vue发送请求时遇到index.vue6ced90 Uncaught (in promise) TypeError Cannot read properties of undefined

时间:2022-02-13 16:22:09

相关推荐

vue发送请求时遇到index.vue6ced90 Uncaught (in promise) TypeError Cannot read properties of undefined

项目中遇到问题如下:

查阅资料得知:

发请求的时候用的是异步模式,即使promise立刻被处理返回,但是浏览器在开始加载对象的时候,这个对象还是没有定义,所以也就读不到返回的值属性。

将原来的函数改为:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。