diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index b54f5469ce2..07ee84a3982 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -13,7 +13,7 @@ let currentFlushPromise: Promise | null = null let isFlushing = false let isFlushPending = false -let flushIndex = 0 +let flushIndex = -1 let pendingPostFlushCbs: Function[] | null = null let pendingPostFlushIndex = 0 @@ -114,7 +114,7 @@ function flushJobs(seen?: CountMap) { callWithErrorHandling(job, null, ErrorCodes.SCHEDULER) } } - flushIndex = 0 + flushIndex = -1 queue.length = 0 flushPostFlushCbs(seen)