Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is vuex physically stored?

How can i access vuex data using the console or any other method when my vue app is on production?

Can't use Vue Devtools because i am on production

like image 860
LuisEnMarroquin Avatar asked Apr 17 '19 15:04

LuisEnMarroquin


People also ask

Where is Vuex data stored?

Storing Data in Vuex In Vuex, our data store is defined as state in the store/index. js config object. Even though it sounds like new terminology to learn, think of it as the data property that we have been using this whole time.

How does Vuex store data in store?

use(Vuex); export default new Vuex. Store({ state: { data: null }, mutations: { getData(state, newData) { state. data = newData; }, }, actions: {}, modules: {}, }); Here I add a data property in the state and give it a value of null, then I add the mutation.

Is Vuex local?

vuex-local achieves simple and trackable local state management. We can define a local Vuex module in each component and it will be registered on a Vuex store. This let us use features of dev tools such as time-travel debugging for local state. In addition we can use a local module on a component in natural way.

Is Vuex store persistent?

The Vuex store is usually not persisted. It is handled like regular JavaScript: After the page is reloaded, the data is released.


1 Answers

You can access the Vuex store from the dev console by querying any element that has Vue properties. For example:

document.getElementsByTagName('a')[0].__vue__.$store

If you are using nuxt, you can also access it from

window.$nuxt.$store
like image 124
Andrei Savin Avatar answered Oct 05 '22 23:10

Andrei Savin