Skip to content

Commit

Permalink
translate getters cache feature from English version into Chinese (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
ypwlal authored and ktsn committed Aug 6, 2017
1 parent 009f4f9 commit fac3db2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/zh-cn/getters.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ computed: {

如果有多个组件需要用到此属性,我们要么复制这个函数,或者抽取到一个共享函数然后在多处导入它 —— 无论哪种方式都不是很理想。

Vuex 允许我们在 store 中定义『getters』(可以认为是 store 的计算属性)。Getters 接受 state 作为其第一个参数:
Vuex 允许我们在 store 中定义『getters』(可以认为是 store 的计算属性)。就像计算属性一样,getters的返回值会根据它的依赖被缓存起来,且只有当它的依赖值发生了改变才会被重新计算。

Getters 接受 state 作为其第一个参数:

``` js
const store = new Vuex.Store({
Expand Down

0 comments on commit fac3db2

Please sign in to comment.