第二阶段代码
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user