Take you to understand Vuex in one minute (recommended for novices)

What is Vuex?

Vuex is a state management mode specially developed for Vue.js applications. It uses a centralized storage management application for the state of all components and uses corresponding rules to ensure that the state changes in a predictable manner.

To understand Vuex, you must first understand its properties

state : storage state (variable)
getters : recompile before data acquisition, which can be understood as the calculated properties of state, ﹩soter.getters.fun()
mutations : modify the state, and it is synchronized, similar to the custom event in the component ,
Use ﹩store.commit(" ", params)
actions in the component: asynchronous operation, use ﹩stort.dispath(" ") in the component
modules : sub-module of stor, in order to develop large-scale projects and facilitate state management in use

以上就是vuex中的属性以及用法,相信会对你有一定帮助,三连走一走,活到九十九

Guess you like

Origin blog.csdn.net/zxlong020/article/details/108392842