]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): ensure $forceUpdate behavior consistency with 2.x
authorEvan You <yyx990803@gmail.com>
Fri, 13 Dec 2019 03:12:45 +0000 (22:12 -0500)
committerEvan You <yyx990803@gmail.com>
Fri, 13 Dec 2019 03:12:45 +0000 (22:12 -0500)
packages/runtime-core/src/componentProxy.ts

index 02629fdddc625cddee8df88435dc4587782d9037..f9c2c8ee86e1e6c43293dedf2866687f24905562 100644 (file)
@@ -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)
 }