fix: 表单弹窗正文按视口动态限制高度

This commit is contained in:
GouJ committed 2026-09-26 23:35:40 +08:00
1 parent c888dc40d6
commit 38ce68dd04
1 file changed
+3 -14
+3 -14
View File
@@ -14,7 +14,7 @@ const open = defineModel<boolean>('open', { default: false })
:mask-closable="!busy"
:close-on-esc="!busy"
:style="{ width: wide ? '1040px' : '600px' }"
class="app-dialog" :class="{ 'app-dialog--with-footer': $slots.footer }"
class="app-dialog"
role="dialog"
:aria-label="title"
>
@@ -38,27 +38,16 @@ const open = defineModel<boolean>('open', { default: false })
.app-dialog {
@apply max-w-[calc(100vw-32px)] max-h-[calc(100dvh-32px)] flex flex-col overflow-hidden;
}
.app-dialog--with-footer {
height: min(760px, calc(100dvh - 32px));
}
@media (max-width: 760px) {
.app-dialog--with-footer {
height: calc(100dvh - 16px);
}
}
.app-dialog .n-card-header {
@apply shrink-0;
}
.dialog-body-scroll.n-scrollbar {
@apply min-h-0 h-full;
@apply min-h-0;
max-height: calc(100dvh - 220px);
}
.app-dialog .n-card__content {
@apply min-h-0 overflow-hidden;
}
.app-dialog--with-footer .n-card__content {
@apply flex-1;
height: 0;
}
.app-dialog .n-card-header__close {
@apply grid place-items-center w-10 h-10 -m-2 rounded-none bg-transparent;
}