fix(@vben-core/shadcn-ui): 补全 ScrollArea onScroll 滚动事件透传 (#8069)
This commit is contained in:
@@ -11,10 +11,13 @@ import { ScrollAreaCorner, ScrollAreaRoot, ScrollAreaViewport } from 'reka-ui';
|
|||||||
import ScrollBar from './ScrollBar.vue';
|
import ScrollBar from './ScrollBar.vue';
|
||||||
|
|
||||||
const props = defineProps<
|
const props = defineProps<
|
||||||
ScrollAreaRootProps & { class?: HTMLAttributes['class'] }
|
ScrollAreaRootProps & {
|
||||||
|
class?: HTMLAttributes['class'];
|
||||||
|
onScroll?: (event: Event) => void;
|
||||||
|
}
|
||||||
>();
|
>();
|
||||||
|
|
||||||
const delegatedProps = reactiveOmit(props, 'class');
|
const delegatedProps = reactiveOmit(props, 'class', 'onScroll');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -27,6 +30,7 @@ const delegatedProps = reactiveOmit(props, 'class');
|
|||||||
as-child
|
as-child
|
||||||
data-slot="scroll-area-viewport"
|
data-slot="scroll-area-viewport"
|
||||||
class="h-full w-full rounded-[inherit] focus:outline-hidden"
|
class="h-full w-full rounded-[inherit] focus:outline-hidden"
|
||||||
|
@scroll="props.onScroll"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</ScrollAreaViewport>
|
</ScrollAreaViewport>
|
||||||
|
|||||||
Reference in New Issue
Block a user