fix(Popup): lockScroll not work #7738

This commit is contained in:
chenjiahan
2020-12-27 21:13:07 +08:00
parent 82acfb2f6e
commit c114a0ef47
6 changed files with 78 additions and 18 deletions
+6
View File
@@ -1,5 +1,11 @@
# 更新日志
### v1.0.1
`2020-12-27`
- 导出个别内部方法供 Vant 使用
### v1.0.0
`2020-12-15`
@@ -28,12 +28,15 @@ export function getScrollParent(el: Element, root: ScrollElement = window) {
return root;
}
export function useScrollParent(el: Ref<Element | undefined>) {
export function useScrollParent(
el: Ref<Element | undefined>,
root: ScrollElement = window
) {
const scrollParent = ref<Element | Window>();
onMounted(() => {
if (el.value) {
scrollParent.value = getScrollParent(el.value);
scrollParent.value = getScrollParent(el.value, root);
}
});