| 1234567891011121314151617181920212223242526272829303132 |
- import { O as windowWidth, F as windowHeight, E as useRect } from "./index-487cde8c.js";
- import { o as onPopupReopen } from "./on-popup-reopen-c5ca1603.js";
- import { r as ref, o as onMounted, z as nextTick, w as watch, c as createVNode } from "./index-5e4623ce.js";
- const useHeight = (element, withSafeArea) => {
- const height = ref();
- const setHeight = () => {
- height.value = useRect(element).height;
- };
- onMounted(() => {
- nextTick(setHeight);
- if (withSafeArea) {
- for (let i = 1; i <= 3; i++) {
- setTimeout(setHeight, 100 * i);
- }
- }
- });
- onPopupReopen(() => nextTick(setHeight));
- watch([windowWidth, windowHeight], setHeight);
- return height;
- };
- function usePlaceholder(contentRef, bem) {
- const height = useHeight(contentRef, true);
- return (renderContent) => createVNode("div", {
- "class": bem("placeholder"),
- "style": {
- height: height.value ? `${height.value}px` : void 0
- }
- }, [renderContent()]);
- }
- export {
- usePlaceholder as u
- };
|