js $store is not defined
时间: 2023-08-21 22:07:02 浏览: 152
store.js
问题的原因是在使用vuex的时候,$store未定义。根据提供的引用内容,可以看出问题出在store/index.js文件中引入vue的方式上。在该文件中,应该使用小写的vue来引入,而不是大写的Vue。所以需要将import Vue from 'vue'中的Vue改为vue,即import vue from 'vue'。这样就能正确地使用$store了。
#### 引用[.reference_title]
- *1* [使用vuex 报错Property or method “$store“ is not defined](https://blog.csdn.net/honeycandys/article/details/118197725)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [vuex中$store is not defined](https://blog.csdn.net/jinyuyang78/article/details/103363589)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文