feat: 发布2.8版本

This commit is contained in:
chenchun
2025-12-17 12:10:24 +08:00
parent 2714a507d9
commit 6f1efafd86
78 changed files with 12043 additions and 92 deletions

View File

@@ -0,0 +1,29 @@
// useScrollDetector.ts
import type { Ref } from 'vue';
import { onBeforeUnmount, onMounted, ref } from 'vue';
export default (elementRef: Ref<HTMLElement | null | undefined>) => {
const hasVertical = ref(false);
const hasHorizontal = ref(false);
const check = () => {
const el = elementRef.value;
if (!el)
return;
hasVertical.value = el.scrollHeight > el.clientHeight;
hasHorizontal.value = el.scrollWidth > el.clientWidth;
};
onMounted(() => {
check();
const observer = new ResizeObserver(check);
observer.observe(elementRef.value!);
onBeforeUnmount(() => observer.disconnect());
});
return {
hasVertical, // 是否有纵向滚动条
hasHorizontal, // 是否有横向滚动条
check, // 检查滚动条状态
};
};