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

This commit is contained in:
Evan You 2019-12-12 22:12:45 -05:00
parent 2c3c65772b
commit 7431c2e46e

View 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)
}