From a5b6d44b3f8962939d8df2cbe0c81d805da0f456 Mon Sep 17 00:00:00 2001 From: Yukon123 <82578034+Yukon123@users.noreply.github.com> Date: Wed, 18 Aug 2021 11:53:07 +0800 Subject: [PATCH 1/2] Update reactivity-computed-watchers.md --- src/guide/reactivity-computed-watchers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guide/reactivity-computed-watchers.md b/src/guide/reactivity-computed-watchers.md index 8444a193e7..97df738be1 100644 --- a/src/guide/reactivity-computed-watchers.md +++ b/src/guide/reactivity-computed-watchers.md @@ -4,7 +4,7 @@ ## Computed values -Sometimes we need state that depends on other state - in Vue this is handled with component [computed properties](computed.html#computed-properties). To directly create a computed value, we can use the `computed` method: it takes a getter function and returns an immutable reactive [ref](reactivity-fundamentals.html#creating-standalone-reactive-values-as-refs) object for the returned value from the getter. +Sometimes we need state that depends on other state - in Vue this is handled with component [computed properties](computed.html#computed-properties). To directly create a computed value, we can use the `computed` function: it takes a getter function and returns an immutable reactive [ref](reactivity-fundamentals.html#creating-standalone-reactive-values-as-refs) object for the returned value from the getter. ```js const count = ref(1) From 6c9616be92d8576179985324a118e8af9d14ba3b Mon Sep 17 00:00:00 2001 From: Yukon123 <82578034+Yukon123@users.noreply.github.com> Date: Wed, 18 Aug 2021 14:24:41 +0800 Subject: [PATCH 2/2] Update reactivity-computed-watchers.md --- src/guide/reactivity-computed-watchers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guide/reactivity-computed-watchers.md b/src/guide/reactivity-computed-watchers.md index 97df738be1..b1860b03ef 100644 --- a/src/guide/reactivity-computed-watchers.md +++ b/src/guide/reactivity-computed-watchers.md @@ -62,7 +62,7 @@ count.value++ ## `watchEffect` -To apply and _automatically re-apply_ a side effect based on reactive state, we can use the `watchEffect` method. It runs a function immediately while reactively tracking its dependencies and re-runs it whenever the dependencies are changed. +To apply and _automatically re-apply_ a side effect based on reactive state, we can use the `watchEffect` function. It runs a function immediately while reactively tracking its dependencies and re-runs it whenever the dependencies are changed. ```js const count = ref(0) @@ -245,7 +245,7 @@ firstName.value = 'John' // logs: ["John", ""] ["", ""] lastName.value = 'Smith' // logs: ["John", "Smith"] ["John", ""] ``` -However, if you are changing both watched sources simultaneously in the same method, the watcher will be executed only once: +However, if you are changing both watched sources simultaneously in the same function, the watcher will be executed only once: ```js{9-13} setup() {