What vuex that? What are the attributes?

Vuex is a specially developed for Vue.js application state management. Simply put, to facilitate data transfer between the components and assembly Sons.
There are five kinds, namely, state, getter, mutation, action, module

What vuex the store that?
vuex is a warehouse, warehouse put a lot of objects. State wherein the data source is stored, the data corresponding to the general vue datastate stored inside the object of which is responsive, store the data read from vue component, if the component data store is changed, the data-dependent phase which may also occur mapState update it by mapping the global state getters and computed properties of the current component calculation.

What vuex of a getter?
getter operation State can be calculated, which is calculated attribute store the calculated properties can also be done while in the module, but may be multiplexed between the getters give a member state only if used within a component, is not getters.

What vuex of mutation that?
The only way to change Vuex the store is in a state of submission mutation. In other words, the first two are state value itself, mutations is changing the executor state.
Note: mutations can only change state simultaneously.

What vuex of action that?
action similar muation, except that: action is submitted mutation, rather than directly changing the state of the asynchronous operation can contain any action in vue ajax request code should be written in assembly or methods of action in vuex.

What vuex the module is the?
The face of complex applications, when the management of the state relatively long time; we need to divide vuex the store objects into modules (modules).

Released nine original articles · won praise 15 · views 1027

Guess you like

Origin blog.csdn.net/qq_43361084/article/details/105224357