diff --git a/src/components/Container/src/ScrollContainer.vue b/src/components/Container/src/ScrollContainer.vue index 4aaa25d3..2f955e47 100644 --- a/src/components/Container/src/ScrollContainer.vue +++ b/src/components/Container/src/ScrollContainer.vue @@ -6,6 +6,10 @@ import { useScrollTo } from '@/hooks/event/useScrollTo' defineOptions({ name: 'ScrollContainer' }) +defineProps({ + scrollHeight: { type: Number }, +}) + const scrollbarRef = ref>(null) /** @@ -72,7 +76,12 @@ defineExpose({ scrollbarRef, scrollTo, scrollBottom, getScrollWrap }) diff --git a/src/components/Modal/src/components/ModalWrapper.vue b/src/components/Modal/src/components/ModalWrapper.vue index 705d7c1b..e8c7bef9 100644 --- a/src/components/Modal/src/components/ModalWrapper.vue +++ b/src/components/Modal/src/components/ModalWrapper.vue @@ -26,7 +26,7 @@ const spinRef = ref(null) const realHeightRef = ref(0) const minRealHeightRef = ref(0) -let realHeight = 0 +const realHeight = ref(0); const stopElResizeFn: Fn = () => {} @@ -122,13 +122,13 @@ async function setModalHeight() { return await nextTick() // if (!realHeight) { - realHeight = spinEl.scrollHeight + realHeight.value = spinEl.scrollHeight // } if (props.fullScreen) realHeightRef.value = window.innerHeight - props.modalFooterHeight - props.modalHeaderHeight - 28 else - realHeightRef.value = props.height ? props.height : realHeight > maxHeight ? maxHeight : realHeight + realHeightRef.value = props.height ? props.height : realHeight.value > maxHeight ? maxHeight : realHeight.value emit('heightChange', unref(realHeightRef)) } @@ -141,7 +141,7 @@ defineExpose({ scrollTop })