Skip to content

Commit 43ee479

Browse files
Eido95phanan
authored andcommitted
Clarify computed properties reactive dependencies (vuejs#2044)
1 parent 00514e7 commit 43ee479

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/v2/guide/computed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ methods: {
9494
}
9595
```
9696

97-
Instead of a computed property, we can define the same function as a method instead. For the end result, the two approaches are indeed exactly the same. However, the difference is that **computed properties are cached based on their dependencies.** A computed property will only re-evaluate when some of its dependencies have changed. This means as long as `message` has not changed, multiple access to the `reversedMessage` computed property will immediately return the previously computed result without having to run the function again.
97+
Instead of a computed property, we can define the same function as a method instead. For the end result, the two approaches are indeed exactly the same. However, the difference is that **computed properties are cached based on their reactive dependencies.** A computed property will only re-evaluate when some of its reactive dependencies have changed. This means as long as `message` has not changed, multiple access to the `reversedMessage` computed property will immediately return the previously computed result without having to run the function again.
9898

9999
This also means the following computed property will never update, because `Date.now()` is not a reactive dependency:
100100

0 commit comments

Comments
 (0)