diff --git a/src/components/Dialog/src/Dialog.vue b/src/components/Dialog/src/Dialog.vue index 98336fdf..82caa225 100644 --- a/src/components/Dialog/src/Dialog.vue +++ b/src/components/Dialog/src/Dialog.vue @@ -8,8 +8,9 @@ const props = defineProps({ modelValue: propTypes.bool.def(false), title: propTypes.string.def('Dialog'), fullscreen: propTypes.bool.def(true), - maxHeight: propTypes.oneOfType([String, Number]).def('300px'), - width: propTypes.oneOfType([String, Number]).def('40%') + width: propTypes.oneOfType([String, Number]).def('40%'), + scroll: propTypes.bool.def(false), // 是否开启滚动条。如果是的话,按照 maxHeight 设置最大高度 + maxHeight: propTypes.oneOfType([String, Number]).def('300px') }) const getBindValue = computed(() => { @@ -35,6 +36,7 @@ const dialogHeight = ref(isNumber(props.maxHeight) ? `${props.maxHeight}px` : pr watch( () => isFullscreen.value, async (val: boolean) => { + // 计算最大高度 await nextTick() if (val) { const windowHeight = document.documentElement.offsetHeight @@ -80,9 +82,12 @@ const dialogStyle = computed(() => { - + + + +