feat(form): form dialog新增show close/show cancel 配置

This commit is contained in:
roymondchen 2025-11-20 17:57:44 +08:00
parent fa0e10f687
commit 310054b7d6
3 changed files with 8 additions and 1 deletions

View File

@ -128,6 +128,7 @@ export interface DialogProps {
closeOnClickModal?: boolean;
closeOnPressEscape?: boolean;
destroyOnClose?: boolean;
showClose?: boolean;
}
export interface DividerProps {

View File

@ -11,6 +11,7 @@
:close-on-click-modal="closeOnClickModal"
:close-on-press-escape="closeOnPressEscape"
:destroy-on-close="destroyOnClose"
:show-close="showClose"
@close="closeHandler"
>
<div
@ -44,7 +45,7 @@
</TMagicCol>
<TMagicCol :span="12">
<slot name="footer">
<TMagicButton @click="cancel" size="small"> </TMagicButton>
<TMagicButton v-if="showCancel" @click="cancel" size="small"> </TMagicButton>
<TMagicButton v-if="hasStep && stepActive > 1" type="info" size="small" @click="preStep"
>上一步</TMagicButton
>
@ -92,6 +93,8 @@ const props = withDefaults(
closeOnClickModal?: boolean;
closeOnPressEscape?: boolean;
destroyOnClose?: boolean;
showClose?: boolean;
showCancel?: boolean;
}>(),
{
config: () => [],
@ -100,6 +103,8 @@ const props = withDefaults(
closeOnClickModal: false,
closeOnPressEscape: false,
destroyOnClose: false,
showClose: true,
showCancel: true,
},
);

View File

@ -5,6 +5,7 @@
:header="title"
:width="width"
:mode="fullscreen ? 'full-screen' : 'modal'"
:close-btn="showClose"
:close-on-overlay-click="closeOnClickModal"
:close-on-esc-keydown="closeOnPressEscape"
:destroy-on-close="destroyOnClose"