Skip to content

Commit 2ccf9da

Browse files
vuejs-jp-botpotato4d
authored andcommitted
Add comments about $watch behavior with a function (#1946) (#1395)
1 parent fdbabcd commit 2ccf9da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/v2/api/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,9 @@ updated: 2018-12-26
14881488
// 関数
14891489
vm.$watch(
14901490
function () {
1491+
// everytime the expression `this.a + this.b` yields a different result,
1492+
// the handler will be called. It's as if we were watching a computed
1493+
// property without defining the computed property itself
14911494
return this.a + this.b
14921495
},
14931496
function (newVal, oldVal) {

0 commit comments

Comments
 (0)