Skip to content

Commit 9e1ae06

Browse files
authored
Update reactivity-computed-watchers.md (#1187)
* Update reactivity-computed-watchers.md * Update reactivity-computed-watchers.md
1 parent 5932d5b commit 9e1ae06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/guide/reactivity-computed-watchers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
## Computed values
66

7-
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.
7+
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.
88

99
```js
1010
const count = ref(1)
@@ -62,7 +62,7 @@ count.value++
6262

6363
## `watchEffect`
6464

65-
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.
65+
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.
6666

6767
```js
6868
const count = ref(0)
@@ -245,7 +245,7 @@ firstName.value = 'John' // logs: ["John", ""] ["", ""]
245245
lastName.value = 'Smith' // logs: ["John", "Smith"] ["John", ""]
246246
```
247247

248-
However, if you are changing both watched sources simultaneously in the same method, the watcher will be executed only once:
248+
However, if you are changing both watched sources simultaneously in the same function, the watcher will be executed only once:
249249

250250
```js{9-13}
251251
setup() {

0 commit comments

Comments
 (0)