Skip to content

Commit 7cd45cf

Browse files
defccchrisvfritz
authored andcommitted
update vm.$watch api info (#570)
1 parent 66ce407 commit 7cd45cf

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/v2/api/index.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
10171017

10181018
- **Usage:**
10191019

1020-
Watch an expression or a computed function on the Vue instance for changes. The callback gets called with the new value and the old value. The expression can be a single keypath or any valid binding expressions.
1020+
Watch an expression or a computed function on the Vue instance for changes. The callback gets called with the new value and the old value. The expression only accepts simple dot-delimited paths. For more complex expression, use a function instead.
10211021

10221022
<p class="tip">Note: when mutating (rather than replacing) an Object or an Array, the old value will be the same as new value because they reference the same Object/Array. Vue doesn't keep a copy of the pre-mutate value.</p>
10231023

@@ -1029,11 +1029,6 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
10291029
// do something
10301030
})
10311031

1032-
// expression
1033-
vm.$watch('a + b', function (newVal, oldVal) {
1034-
// do something
1035-
})
1036-
10371032
// function
10381033
vm.$watch(
10391034
function () {

0 commit comments

Comments
 (0)