From 7431c2e46e4d5c94632a34a6ff44ef0dd4f4ef8b Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 12 Dec 2019 22:12:45 -0500 Subject: [PATCH] fix(runtime-core): ensure $forceUpdate behavior consistency with 2.x --- packages/runtime-core/src/componentProxy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index 02629fdddc..f9c2c8ee86 100644 --- a/packages/runtime-core/src/componentProxy.ts +++ b/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) } -- 2.47.3