We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dae1f3d commit 065b8b3Copy full SHA for 065b8b3
src/core/observer/watcher.js
@@ -40,15 +40,19 @@ export default class Watcher {
40
vm: Component,
41
expOrFn: string | Function,
42
cb: Function,
43
- options?: Object = {}
+ options?: Object
44
) {
45
this.vm = vm
46
vm._watchers.push(this)
47
// options
48
- this.deep = !!options.deep
49
- this.user = !!options.user
50
- this.lazy = !!options.lazy
51
- this.sync = !!options.sync
+ if (options) {
+ this.deep = !!options.deep
+ this.user = !!options.user
+ this.lazy = !!options.lazy
52
+ this.sync = !!options.sync
53
+ } else {
54
+ this.deep = this.user = this.lazy = this.sync = false
55
+ }
56
this.cb = cb
57
this.id = ++uid // uid for batching
58
this.active = true
0 commit comments