Forráskód Böngészése

fix(runtime-core): ensure $forceUpdate behavior consistency with 2.x

Evan You 6 éve
szülő
commit
7431c2e46e
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      packages/runtime-core/src/componentProxy.ts

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

@@ -1,5 +1,5 @@
 import { ComponentInternalInstance, Data, Emit } from './component'
-import { nextTick } from './scheduler'
+import { nextTick, queueJob } from './scheduler'
 import { instanceWatch } from './apiWatch'
 import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared'
 import {
@@ -61,7 +61,7 @@ const publicPropertiesMap: Record<
   $root: i => i.root,
   $emit: i => i.emit,
   $options: i => i.type,
-  $forceUpdate: i => i.update,
+  $forceUpdate: i => () => queueJob(i.update),
   $nextTick: () => nextTick,
   $watch: i => instanceWatch.bind(i)
 }