diff --git a/src/ui/components/FaScrollArea/index.vue b/src/ui/components/FaScrollArea/index.vue index 81341e22..a62c8eac 100755 --- a/src/ui/components/FaScrollArea/index.vue +++ b/src/ui/components/FaScrollArea/index.vue @@ -25,6 +25,10 @@ const props = withDefaults( }, ) +const emits = defineEmits<{ + onScroll: [Event] +}>() + const scrollAreaRef = useTemplateRef('scrollAreaRef') const arrivedState = ref<{ @@ -46,6 +50,10 @@ const showMaskEnd = computed(() => { return !arrivedState.value?.bottom }) +function onScroll(event: Event) { + emits('onScroll', event) +} + function onWheel(event: WheelEvent) { if (props.horizontal) { scrollAreaRef.value?.el?.viewportElement?.scrollBy({ @@ -108,7 +116,7 @@ defineExpose({ '--mask-scroll-container-gradient-color': props.gradientColor, } : {}" > - + diff --git a/src/ui/components/FaScrollArea/scroll-area/ScrollArea.vue b/src/ui/components/FaScrollArea/scroll-area/ScrollArea.vue index 478a6861..85cc3e17 100644 --- a/src/ui/components/FaScrollArea/scroll-area/ScrollArea.vue +++ b/src/ui/components/FaScrollArea/scroll-area/ScrollArea.vue @@ -13,6 +13,7 @@ import ScrollBar from './ScrollBar.vue' const props = defineProps void onWheel?: (event: WheelEvent) => void }>() @@ -31,7 +32,7 @@ defineExpose({