feat: add animation effects to VbenModal component

This commit is contained in:
 panda7
2025-07-18 00:15:40 +08:00
parent 1bc5d2986b
commit 1a9b0509d5
6 changed files with 67 additions and 2 deletions

View File

@@ -59,6 +59,7 @@ export class ModalApi {
showCancelButton: true,
showConfirmButton: true,
title: '',
animationType: 'slide',
};
this.store = new Store<ModalState>(

View File

@@ -5,6 +5,11 @@ import type { MaybePromise } from '@vben-core/typings';
import type { ModalApi } from './modal-api';
export interface ModalProps {
/**
* 动画类型
* @default 'slide'
*/
animationType?: 'scale' | 'slide';
/**
* 是否要挂载到内容区域
* @default false

View File

@@ -94,6 +94,7 @@ const {
submitting,
title,
titleTooltip,
animationType,
zIndex,
} = usePriorityValues(props, state);
@@ -244,6 +245,7 @@ function handleClosed() {
:modal="modal"
:open="state?.isOpen"
:show-close="closable"
:animation-type="animationType"
:z-index="zIndex"
:overlay-blur="overlayBlur"
close-class="top-3"