Skip to content

Commit fac3db2

Browse files
ypwlalktsn
authored andcommitted
translate getters cache feature from English version into Chinese (#864)
1 parent 009f4f9 commit fac3db2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/zh-cn/getters.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ computed: {
1313

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

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

1820
``` js
1921
const store = new Vuex.Store({

0 commit comments

Comments
 (0)