Skip to content

Commit 4b816e2

Browse files
posvaphanan
authored andcommitted
Add comments about $watch behavior with a function (#1946)
1 parent 0cb2514 commit 4b816e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/v2/api/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,9 @@ type: api
14861486
// function
14871487
vm.$watch(
14881488
function () {
1489+
// everytime the expression `this.a + this.b` yields a different result,
1490+
// the handler will be called. It's as if we were watching a computed
1491+
// property without defining the computed property itself
14891492
return this.a + this.b
14901493
},
14911494
function (newVal, oldVal) {

0 commit comments

Comments
 (0)