feat(use): add useScrollParent

This commit is contained in:
chenjiahan
2020-09-12 22:04:02 +08:00
parent 68817e3aba
commit ecbaddd5e1
8 changed files with 91 additions and 52 deletions
-14
View File
@@ -1,14 +0,0 @@
import { Ref, ref, onMounted } from 'vue';
import { getScroller } from '../utils/dom/scroll';
export function useScroller(el: Ref<HTMLElement>) {
const scrollerRef = ref();
onMounted(() => {
if (el.value) {
scrollerRef.value = getScroller(el.value);
}
});
return scrollerRef;
}