Skip to content

Commit fcc21b1

Browse files
fix: computed example should not mutate ref value (vuejs#417)
1 parent 2738ccf commit fcc21b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/guide/reactivity-computed-watchers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Sometimes we need state that depends on other state - in Vue this is handled wit
88

99
```js
1010
const count = ref(1)
11-
const plusOne = computed(() => count.value++)
11+
const plusOne = computed(() => count.value + 1)
1212

1313
console.log(plusOne.value) // 2
1414

0 commit comments

Comments
 (0)