Skip to content

Commit 1fd2fc4

Browse files
committed
docs(zh): update
1 parent 31e4fbc commit 1fd2fc4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/zh/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ new Vue({
5050

5151
另外,通过定义和隔离状态管理中的各种概念并强制遵守一定的规则,我们的代码将会变得更结构化且易维护。
5252

53-
这就是 Vuex 背后的基本思想,借鉴了 [Flux](https://facebook.github.io/flux/docs/overview.html)[Redux](http://redux.js.org/)[The Elm Architecture](https://guide.elm-lang.org/architecture/)。与其他模式不同的是,Vuex 是专门为 Vue.js 设计的状态管理库,以利用 Vue.js 的细粒度数据响应机制来进行高效的状态更新。
53+
这就是 Vuex 背后的基本思想,借鉴了 [Flux](https://facebook.github.io/flux/docs/overview.html)[Redux](http://redux.js.org/) [The Elm Architecture](https://guide.elm-lang.org/architecture/)。与其他模式不同的是,Vuex 是专门为 Vue.js 设计的状态管理库,以利用 Vue.js 的细粒度数据响应机制来进行高效的状态更新。
5454

5555
![vuex](/vuex.png)
5656

docs/zh/guide/modules.md

+4
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,12 @@ store.registerModule(['nested', 'myModule'], {
294294

295295
你也可以使用 `store.unregisterModule(moduleName)` 来动态卸载模块。注意,你不能使用此方法卸载静态模块(即创建 store 时声明的模块)。
296296

297+
#### 保留 state
298+
297299
在注册一个新 module 时,你很有可能想保留过去的 state,例如从一个服务端渲染的应用保留 state。你可以通过 `preserveState` 选项将其归档:`store.registerModule('a', module, { preserveState: true })`
298300

301+
当你设置 `preserveState: true` 时,该模块会被注册,action、mutation 和 getter 会被添加到 store 中,但是 state 不会。这里假设 store 的 state 已经包含了这个 module 的 state 并且你不希望将其覆写。
302+
299303
### 模块重用
300304

301305
有时我们可能需要创建一个模块的多个实例,例如:

0 commit comments

Comments
 (0)