在Vue开发工具中未检测到Vuex存储 [英] No Vuex store detected in Vue Dev Tools
问题描述
出于非常特殊的原因,我在生产中将vue dev工具设置为true.
For very specific reasons, I have set the vue dev tools to true in production.
Vue.config.devtools = true
我使用以下版本:
"vue": "^2.5.2"
"vuex": "^3.0.1"
"vuetify": "^1.0.0"
虽然我可以看到组件和事件,但未检测到Vuex存储.
While I can see the components and events, the Vuex store is not detected.
我曾尝试将vuex版本降级到2.3.1和2.4.x,但没有帮助. 这是我引用的链接- https://github.com/vuejs/vue-devtools/Issues/405
I have tried downgrading the vuex version to 2.3.1 and 2.4.x, but it did not help. Here's the link I referred to - https://github.com/vuejs/vue-devtools/issues/405
注意-该商店运作良好,只是我无法在Vue开发工具中查看它.
Note - The store works well, its just that I am not able to view it in the Vue dev tools.
任何指针都值得赞赏.
推荐答案
在创建商店之前,您必须设置Vue.config.devtools = true
.
you have to set Vue.config.devtools = true
before you create the store.
这是我的store.js:
here my store.js:
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
Vue.config.devtools = true
export const store = new Vuex.Store({
state: {
counter: 0
}
})
这篇关于在Vue开发工具中未检测到Vuex存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!