We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vue] vuex的store有几个属性值?分别讲讲它们的作用是什么?
The text was updated successfully, but these errors were encountered:
https://vuex.vuejs.org/zh/
state:存贮公共数据的地方 Getters:获取公共数据的地方 mutations:放的是同步的操作和reducer有点像 通过store的commit方法来让mutations执行 action:放的是异步的操作 通过dispatch的方法让action里面的方法执行 context是store的一个副本
Vuex就是提供一个仓库,store仓库里面放了很多对象其中state即使数据源存放地,
Sorry, something went wrong.
state:存放公共数据的地方 getter:获取根据业务场景处理返回的数据 mutations:唯一修改state的方法,修改过程是同步的 action:异步处理,通过分发操作触发mutation module:将store模块分割,减少代码臃肿
https://blog.csdn.net/szuwaterbrother/article/details/10622307
const moduleA = { state: () => ({ ... }), mutations: { ... }, actions: { ... }, getters: { ... } } const moduleB = { state: () => ({ ... }), mutations: { ... }, actions: { ... } } const store = new Vuex.Store({ modules: { a: moduleA, b: moduleB } }) store.state.a // -> moduleA 的状态 store.state.b // -> moduleB 的状态
No branches or pull requests
[vue] vuex的store有几个属性值?分别讲讲它们的作用是什么?
The text was updated successfully, but these errors were encountered: