Просмотр исходного кода

fix(runtime-core): fix scheduler dedupe when not flushing

Evan You 5 лет назад
Родитель
Сommit
4ef5c8d424
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/runtime-core/src/scheduler.ts

+ 2 - 2
packages/runtime-core/src/scheduler.ts

@@ -13,7 +13,7 @@ let currentFlushPromise: Promise<void> | 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)