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
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.
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.
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.
The Vuex store is usually not persisted. It is handled like regular JavaScript: After the page is reloaded, the data is released.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With