File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -209,13 +209,15 @@ export function mountComponent(
209209 // we set this to vm._watcher inside the watcher's constructor
210210 // since the watcher's initial patch may call $forceUpdate (e.g. inside child
211211 // component's mounted hook), which relies on vm._watcher being already defined
212+ vm . _scope . on ( )
212213 new Watcher (
213214 vm ,
214215 updateComponent ,
215216 noop ,
216217 watcherOptions ,
217218 true /* isRenderWatcher */
218219 )
220+ vm . _scope . off ( )
219221 hydrating = false
220222
221223 // flush buffer for flush: "pre" watchers queued in setup()
Original file line number Diff line number Diff line change @@ -72,10 +72,8 @@ export default class Watcher implements DepTarget {
7272 isRenderWatcher ?: boolean
7373 ) {
7474 recordEffectScope ( this , activeEffectScope || ( vm ? vm . _scope : undefined ) )
75- if ( ( this . vm = vm ) ) {
76- if ( isRenderWatcher ) {
77- vm . _watcher = this
78- }
75+ if ( ( this . vm = vm ) && isRenderWatcher ) {
76+ vm . _watcher = this
7977 }
8078 // options
8179 if ( options ) {
You can’t perform that action at this time.
0 commit comments