import type { VNode } from './vnode'
import { devtoolsInitApp, devtoolsUnmountApp } from './devtools'
import { NO, extend, isFunction, isObject } from '@vue/shared'
-import { version } from '.'
+import { type TransitionHooks, version } from '.'
import { installAppCompatProperties } from './compat/global'
import type { NormalizedPropsOptions } from './componentProps'
import type { ObjectEmitsOptions } from './componentEmits'
unmount(vnode: VNode, doRemove?: boolean): void
move(vnode: VNode, container: any, anchor: any): void
slot(n1: VNode | null, n2: VNode, container: any, anchor: any): void
+ setTransitionHooks(
+ component: ComponentInternalInstance,
+ transition: TransitionHooks,
+ ): void
vdomMount: (component: ConcreteComponent, props?: any, slots?: any) => any
vdomUnmount: UnmountComponentFn
import {
type ComponentInternalInstance,
type ComponentOptions,
+ type ConcreteComponent,
type GenericComponentInstance,
type SetupContext,
getCurrentInstance,
import { PatchFlags, ShapeFlags, isArray, isFunction } from '@vue/shared'
import { onBeforeUnmount, onMounted } from '../apiLifecycle'
import { isTeleport } from './Teleport'
-import type { RendererElement } from '../renderer'
+import { type RendererElement, getVaporInterface } from '../renderer'
import { SchedulerJobFlags } from '../scheduler'
type Hook<T = () => void> = T | T[]
export function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void {
if (vnode.shapeFlag & ShapeFlags.COMPONENT && vnode.component) {
- if ((vnode.type as any).__vapor) {
- ;(vnode.component as any).block.$transition = hooks
+ if ((vnode.type as ConcreteComponent).__vapor) {
+ getVaporInterface(vnode.component, vnode).setTransitionHooks(
+ vnode.component,
+ hooks,
+ )
} else {
vnode.transition = hooks
setTransitionHooks(vnode.component.subTree, hooks)
}
}
-function getVaporInterface(
+export function getVaporInterface(
instance: ComponentInternalInstance | null,
vnode: VNode,
): VaporInteropInterface {
insert(vnode.vb || (vnode.component as any), container, anchor)
insert(vnode.anchor as any, container, anchor)
},
+
+ setTransitionHooks(component, hooks) {
+ setTransitionToInstance(component as any, hooks as VaporTransitionHooks)
+ },
}
const vaporSlotPropsProxyHandler: ProxyHandler<