You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
1.5 KiB
1 line
1.5 KiB
11 months ago
|
{"version":3,"file":"index.mjs","sources":["../../../../../packages/hooks/use-popper-container/index.ts"],"sourcesContent":["import { onBeforeMount } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { generateId } from '@element-plus/utils/util'\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 // This is for bypassing the error that when under testing env, we often encounter\n // document.body.innerHTML = '' situation\n // for this we need to disable the caching since it's not really needed\n if (process.env.NODE_ENV === 'test' || !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,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,CAAC,eAAe,EAAE;AAC7D,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;;;;"}
|