refactor(runtime-core/scheduler): dedicated preFlush queue
properly fix #1763, #1777, #1781
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
ReactiveEffectOptions,
|
||||
isReactive
|
||||
} from '@vue/reactivity'
|
||||
import { queueJob, SchedulerJob } from './scheduler'
|
||||
import { SchedulerJob, queuePreFlushCb } from './scheduler'
|
||||
import {
|
||||
EMPTY_OBJ,
|
||||
isObject,
|
||||
@@ -271,7 +271,7 @@ function doWatch(
|
||||
job.id = -1
|
||||
scheduler = () => {
|
||||
if (!instance || instance.isMounted) {
|
||||
queueJob(job)
|
||||
queuePreFlushCb(job)
|
||||
} else {
|
||||
// with 'pre' option, the first call must happen before
|
||||
// the component is mounted so it is called synchronously.
|
||||
|
||||
Reference in New Issue
Block a user