import { defineComponent, computed, reactive, onMounted } from 'vue'; import styles from './index.module.less'; // 底部拖动区域 export default defineComponent({ name: 'dragBom', emits: ["guideDone"], props: { /** 是否显示引导 */ showGuide: { type: Boolean, default: false, }, }, setup(props, { emit }) { const data = reactive({ guidePos: "bottom" as "bottom" | "top", }); const initGuidePos = () => { const pageHeight = document.documentElement.clientHeight || document.body.clientHeight; const guideHeight = document.querySelector('.bom_guide')?.getBoundingClientRect().height || 0; const dragTop = document.querySelector('.bom_drag')?.getBoundingClientRect()?.top || 0; data.guidePos = pageHeight - dragTop < guideHeight ? "top" : "bottom"; } onMounted(() => { initGuidePos(); }); return () => ( <>