fix: watcher oldValue

This commit is contained in:
Evan You 2018-10-18 18:21:14 -04:00
parent 7c389606a4
commit 023f4ef7f4

View File

@ -61,12 +61,12 @@ export function setupWatcher(
const applyCb = () => {
const newValue = runner()
if (options.deep || newValue !== oldValue) {
oldValue = newValue
try {
cb.call(instance.$proxy, newValue, oldValue)
} catch (e) {
handleError(e, instance, ErrorTypes.WATCH_CALLBACK)
}
oldValue = newValue
}
}