Initial Vuex state management

How vuex maintain state
a,
1, mounting the install --save vuex NPM
2, register using
Import from Vue 'VUE'
Import from Vuex 'vuex';
Register
Vue.use (Vuex)

2. What is Vuex,
can be understood as a solution to state management, similar to Reactx in React or ngrx in Angular;
it contains the following three important parts:
1. The view declares to initialize the state to be managed Mapped to view
2, state, is the data source to be managed, referred to as state state
3. Actions affect user input on the View to cause actions to occur
3. When to use Vuex

Guess you like

Origin blog.51cto.com/14582569/2536291