Cannot read property 'dispatch' of undefined
时间: 2023-09-14 22:11:06 浏览: 181
PHP微框架Dispatch简介
在你提供的代码中,报错的原因是`this.$store.dispatch`中的`this.$store`是undefined,而undefined没有dispatch属性,所以会出现"Cannot read property 'dispatch' of undefined"的错误。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Vue Cannot read property ‘xxx‘ of undefined](https://blog.csdn.net/weixin_45151873/article/details/115122923)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Uncaught TypeError: Cannot read property ‘dispatch‘ of undefined](https://blog.csdn.net/Yolanda_NuoNuo/article/details/116593311)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文