From 74846a11bdd39b96aace087bf4f25574fa0a6088 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 9 Mar 2023 19:36:57 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BC=98=E5=8C=96=20Dialog=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=20scroll=20=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E6=BB=9A=E5=8A=A8=202.=20=E4=BC=98=E5=8C=96=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=AE=A1=E7=90=86=E7=9A=84=20:default-time=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialog/src/Dialog.vue | 11 ++++++++--- src/views/infra/config/form.vue | 24 +++++++++++++----------- src/views/infra/config/index.vue | 24 +++++++++--------------- 3 files changed, 30 insertions(+), 29 deletions(-) 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(() => { - + + + +