ruoyi-plus-vben5/packages/utils/src/helpers/get-popup-container.ts

7 lines
243 B
TypeScript
Raw Normal View History

/**
* Returns the parent node of the given element or the document body if the element is not provided.it
*/
export function getPopupContainer(node?: HTMLElement): HTMLElement {
return (node?.parentNode as HTMLElement) ?? document.body;
}