- Notifications
You must be signed in to change notification settings - Fork12
Open
Description
There is a conflict with the recent versions of Vue DevTools (5.x+) which is described inissue #914
More specifically, this is related to some additional code inside thehook.once("vuex:init" callback which is missing inVue-Perf-DevTool. The problem manifests itself by Vue DevTools not being able to detect the presence of Vuex store.
The workaround is to disable theVue-Perf-DevTool extension - but the current implementation of thePerformance tab in the recent Vue DevTools is not so informative. So the solution is to add the missing code and update the hook in Vue-Perf-DevTool to reflect the hook in Vue DevTools:
/src/backend/hook.js:
hook.once('vuex:init',store=>{hook.store=store// === the following code must be added ===hook.initialStore={state:clone(store.state),getters:store.getters}// Dynamic modulesif(store.registerModule){hook.storeModules=[]constorigRegister=store.registerModule.bind(store)store.registerModule=(path,module,options)=>{if(typeofpath==='string')path=[path]hook.storeModules.push({ path, module, options})origRegister(path,module,options)}constorigUnregister=store.unregisterModule.bind(store)store.unregisterModule=(path)=>{if(typeofpath==='string')path=[path]constkey=path.join('/')constindex=hook.storeModules.findIndex(m=>m.path.join('/')===key)if(index!==-1)hook.storeModules.splice(0,1)origUnregister(path)}hook.flushStoreModules=()=>{store.registerModule=origRegisterstore.unregisterModule=origUnregisterreturnhook.storeModules}}else{hook.flushStoreModules=()=>[]}})
Metadata
Metadata
Assignees
Labels
No labels