第二阶段代码

This commit is contained in:
2026-04-23 11:37:37 +08:00
parent 618bb6699e
commit ef64c3b7fb
937 changed files with 118372 additions and 10248 deletions

View File

@@ -1,3 +1,5 @@
import type { Ref } from 'vue';
import type { TabsProps } from './types';
import { nextTick, onMounted, onUnmounted, ref, watch } from 'vue';
@@ -8,7 +10,18 @@ import { useDebounceFn } from '@vueuse/core';
type DomElement = Element | null | undefined;
export function useTabsViewScroll(props: TabsProps) {
interface UseTabsViewScrollReturn {
handleScrollAt: ReturnType<typeof useDebounceFn>;
handleWheel: (event: WheelEvent) => void;
initScrollbar: () => Promise<void>;
scrollbarRef: Ref<InstanceType<typeof VbenScrollbar> | null>;
scrollDirection: (direction: 'left' | 'right', distance?: number) => void;
scrollIsAtLeft: Ref<boolean>;
scrollIsAtRight: Ref<boolean>;
showScrollButton: Ref<boolean>;
}
export function useTabsViewScroll(props: TabsProps): UseTabsViewScrollReturn {
let resizeObserver: null | ResizeObserver = null;
let mutationObserver: MutationObserver | null = null;
let tabItemCount = 0;