在 Vue Dev Tools (vue2/vuex3) 中未检测到 Vuex 商店 [英] No Vuex store detected in Vue Dev Tools (vue2/vuex3)
问题描述
出于非常具体的原因,我在生产环境中将 vue 开发工具设置为 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/问题/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.
感谢任何指点.
推荐答案
你必须在创建 store 之前设置 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 Dev Tools (vue2/vuex3) 中未检测到 Vuex 商店的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!