# useScrollParent ### Intro Get the closest parent element that is scrollable. ## Usage ### Basic Usage ```html
``` ```js import { ref, watch } from 'vue'; import { useScrollParent, useEventListener } from '@vant/use'; export default { setup() { const root = ref(); const scrollParent = useScrollParent(root); useEventListener( 'scroll', () => { console.log('scroll'); }, { target: scrollParent } ); return { root }; }, }; ``` ## API ### Type Declarations ```ts function useScrollParent( element: Ref