@@ -22,7 +22,7 @@ const store = new Vuex.Store({ ...options })
2222
2323 - 类型: ` { [type: string]: Function } `
2424
25- 在 store 上注册 mutation,处理函数总是接受 ` state ` 作为第一个参数(如果定义在模块中,则为模块的本地状态 ),` payload ` 作为第二个参数(可选)。
25+ 在 store 上注册 mutation,处理函数总是接受 ` state ` 作为第一个参数(如果定义在模块中,则为模块的局部状态 ),` payload ` 作为第二个参数(可选)。
2626
2727 [ 详细介绍] ( mutations.md )
2828
@@ -34,7 +34,7 @@ const store = new Vuex.Store({ ...options })
3434
3535 ``` js
3636 {
37- state, // 等同于 store.state, 若在模块中则为本地状态
37+ state, // 等同于 store.state, 若在模块中则为局部状态
3838 rootState, // 等同于 store.state, 只存在于模块中
3939 commit, // 等同于 store.commit
4040 dispatch, // 等同于 store.dispatch
@@ -49,9 +49,9 @@ const store = new Vuex.Store({ ...options })
4949 - 类型: ` { [key: string]: Function }`
5050
5151 在 store 上注册 getter,getter 方法接受以下参数:
52-
52+
5353 ```
54- state, // 如果在模块中定义则为模块的本地状态
54+ state, // 如果在模块中定义则为模块的局部状态
5555 getters, // 等同于 store.getters
5656 rootState // 等同于 store.state
5757 ```
@@ -78,7 +78,7 @@ const store = new Vuex.Store({ ...options })
7878 }
7979 ` ` `
8080
81- 与根模块的选项一样,每个模块也包含 ` state` 和 ` mutations` 选项。模块的状态使用 key 关联到 store 的根状态。模块的 mutation 和 getter 只会接收 module 的本地状态作为第一个参数 ,而不是根状态,并且模块 action 的 ` context.state` 同样指向本地状态 。
81+ 与根模块的选项一样,每个模块也包含 ` state` 和 ` mutations` 选项。模块的状态使用 key 关联到 store 的根状态。模块的 mutation 和 getter 只会接收 module 的局部状态作为第一个参数 ,而不是根状态,并且模块 action 的 ` context.state` 同样指向局部状态 。
8282
8383 [详细介绍](modules .md )
8484
0 commit comments