Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Vuex Store accessible from console or from client's browser?

I'm building this Vue 2 app, and I keep reading that one should use Vuex State management, in the beginning I didn't quite understand it's concept, but now after playing around with Vue, I can see it's a most for a larger app.

But my question is can someone from Dev console or in any form access data which are stored in store.js, I mean those data which I do not render to browser?

Can I keep sensitive data on store, by sensitive, I mean, user clicked this link, sent message to this user, spent so much time on this page etc... and in mean time upload all this data to my db..

Is Vuex Store for this kind of work/job ?

Cheers

like image 271
Marketingexpert Avatar asked Apr 17 '17 23:04

Marketingexpert


People also ask

Is Vuex store shared between tabs?

This Vuex plugin allows you to sync and share the status of your Vue application across multiple tabs or windows using the local storage.

How does Vuex store work?

Vuex is a state management pattern + library for Vue. js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.

Where does Vuex store its data?

At the center of every Vuex application is the store. A "store" is basically a container that holds your application state. There are two things that make a Vuex store different from a plain global object: Vuex stores are reactive.

Does Vuex store persist?

vuex-persist. A Typescript-ready Vuex plugin that enables you to save the state of your app to a persisted storage like Cookies or localStorage.


1 Answers

Yes they can.

The invocation I use is

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

This assumes the first link has vue properties, which is almost always the case. If not, try other tags. The UI is unpleasant, but adequately self-documenting. It's a useful debugging tool and something a user could do.

Of course, a determined and skilled user could write a browser plugin to put a good UI on this. Or maybe that's what the Vue.js devtools extension for Chrome does? I haven't actually used that.

like image 63
dspeyer Avatar answered Sep 20 '22 14:09

dspeyer