refactor: move template ref setter into dedicated file

This commit is contained in:
Evan You
2021-12-11 09:05:51 +08:00
parent 41c18effea
commit 1928c9b537
6 changed files with 157 additions and 143 deletions

View File

@@ -42,6 +42,7 @@ import { hmrDirtyComponents } from './hmr'
import { convertLegacyComponent } from './compat/component'
import { convertLegacyVModelProps } from './compat/componentVModel'
import { defineLegacyVNodeProperties } from './compat/renderFn'
import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
export const Fragment = Symbol(__DEV__ ? 'Fragment' : undefined) as any as {
__isFragment: true
@@ -811,3 +812,15 @@ export function mergeProps(...args: (Data & VNodeProps)[]) {
}
return ret
}
export function invokeVNodeHook(
hook: VNodeHook,
instance: ComponentInternalInstance | null,
vnode: VNode,
prevVNode: VNode | null = null
) {
callWithAsyncErrorHandling(hook, instance, ErrorCodes.VNODE_HOOK, [
vnode,
prevVNode
])
}