vuex basis

  vuex state management model, using the state of centralized storage management application of all components, and a corresponding state rules to ensure a predictable manner changed;

  Each core is vuex application store, store can be seen as a container, with a relatively similar data, contains most of the state status of the application; vuex all ordinary two different objects:

    1), vuex state memory is responsive to; vue assembly when the state read from the store, the store if the state changes, the response of the assembly will efficiently obtained corresponding updated;

    2), inside vuex store the data not directly change, change the state of the store only explicit commit mutation, i.e., a method of mutation by submission commit; so we can easily follow a change of state;

  vuex including state, getter, mutation, action module attributes and methods, wherein the state corresponds vue assembly data, getter assembly similar vue computed, mutation group similar to the methods; action similar mutation, different action is submitted that mutation, rather than directly changing the State, the action may comprise an asynchronous operation; action call distribution need to use in the method, i.e. store.dispatch ( 'acitonMd')

  

Guess you like

Origin www.cnblogs.com/mufc/p/11423232.html