Skip to content

Commit 99483b7

Browse files
committed
Allow reference to watcher to be available during create.
1 parent 2fe7185 commit 99483b7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/core/instance/lifecycle.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ export function mountComponent (
193193
}
194194
}
195195

196-
vm._watcher = new Watcher(vm, updateComponent, noop)
196+
vm._watcher = new Watcher(vm, updateComponent, noop, { delayed: true })
197+
vm._watcher.get()
197198
hydrating = false
198199

199200
// manually mounted instance, call mounted on self

src/core/observer/watcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default class Watcher {
8383
}
8484
}
8585
this.getter = wrapWatcherGetter(this.getter)
86-
this.value = this.lazy
86+
this.value = this.lazy || (options && options.delayed)
8787
? undefined
8888
: this.get()
8989
}

0 commit comments

Comments
 (0)