fix(runtime-core): ensure consistent identity of $forceUpdate and $nextTick instance methods
fix #5556
This commit is contained in:
parent
8ccbb0912a
commit
d52907f4eb
@ -440,6 +440,15 @@ export interface ComponentInternalInstance {
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
[LifecycleHooks.SERVER_PREFETCH]: LifecycleHook<() => Promise<unknown>>
|
[LifecycleHooks.SERVER_PREFETCH]: LifecycleHook<() => Promise<unknown>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For caching bound $forceUpdate on public proxy access
|
||||||
|
*/
|
||||||
|
f?: () => void
|
||||||
|
/**
|
||||||
|
* For caching bound $nextTick on public proxy access
|
||||||
|
*/
|
||||||
|
n?: () => Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
const emptyAppContext = createAppContext()
|
const emptyAppContext = createAppContext()
|
||||||
|
@ -252,8 +252,8 @@ export const publicPropertiesMap: PublicPropertiesMap =
|
|||||||
$root: i => getPublicInstance(i.root),
|
$root: i => getPublicInstance(i.root),
|
||||||
$emit: i => i.emit,
|
$emit: i => i.emit,
|
||||||
$options: i => (__FEATURE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type),
|
$options: i => (__FEATURE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type),
|
||||||
$forceUpdate: i => () => queueJob(i.update),
|
$forceUpdate: i => i.f || (i.f = () => queueJob(i.update)),
|
||||||
$nextTick: i => nextTick.bind(i.proxy!),
|
$nextTick: i => i.n || (i.n = nextTick.bind(i.proxy!)),
|
||||||
$watch: i => (__FEATURE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)
|
$watch: i => (__FEATURE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP)
|
||||||
} as PublicPropertiesMap)
|
} as PublicPropertiesMap)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user