vue3-core/packages/runtime-vapor/src/insertionState.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
573 B
TypeScript
Raw Normal View History

2025-04-30 08:33:57 +08:00
export let insertionParent: ParentNode | undefined
export let insertionAnchor: Node | 0 | undefined
2025-03-10 16:18:02 +08:00
/**
* This function is called before a block type that requires insertion
* (component, slot outlet, if, for) is created. The state is used for actual
* insertion on client-side render, and used for node adoption during hydration.
*/
export function setInsertionState(parent: ParentNode, anchor?: Node | 0): void {
insertionParent = parent
insertionAnchor = anchor
}
export function resetInsertionState(): void {
insertionParent = insertionAnchor = undefined
}