element-plus
Version:
A Component Library for Vue 3
1 lines • 1.28 kB
Source Map (JSON)
{"version":3,"file":"container.mjs","sources":["../../../../../../packages/components/popper/src/container.ts"],"sourcesContent":["import { onBeforeMount } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { generateId } from '@element-plus/utils'\n\nlet cachedContainer: HTMLElement\n\nexport const POPPER_CONTAINER_ID = `el-popper-container-${generateId()}`\n\nexport const POPPER_CONTAINER_SELECTOR = `#${POPPER_CONTAINER_ID}`\n\nexport const usePopperContainer = () => {\n onBeforeMount(() => {\n if (!isClient) return\n\n if (!cachedContainer) {\n const container = document.createElement('div')\n container.id = POPPER_CONTAINER_ID\n document.body.appendChild(container)\n cachedContainer = container\n }\n })\n}\n"],"names":[],"mappings":";;;;;AAGA,IAAI,eAAe,CAAC;AACR,MAAC,mBAAmB,GAAG,CAAC,oBAAoB,EAAE,UAAU,EAAE,CAAC,EAAE;AAC7D,MAAC,yBAAyB,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,EAAE;AACvD,MAAC,kBAAkB,GAAG,MAAM;AACxC,EAAE,aAAa,CAAC,MAAM;AACtB,IAAI,IAAI,CAAC,QAAQ;AACjB,MAAM,OAAO;AACb,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACtD,MAAM,SAAS,CAAC,EAAE,GAAG,mBAAmB,CAAC;AACzC,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;AAC3C,MAAM,eAAe,GAAG,SAAS,CAAC;AAClC,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;"}