This commit is contained in:
dap
2024-09-13 10:28:23 +08:00
35 changed files with 478 additions and 161 deletions

View File

@@ -29,10 +29,12 @@ export class DrawerApi {
} = options;
const defaultState: DrawerState = {
class: '',
closable: true,
closeOnClickModal: true,
closeOnPressEscape: true,
confirmLoading: false,
contentClass: '',
footer: true,
isOpen: false,
loading: false,

View File

@@ -7,6 +7,7 @@ export interface DrawerProps {
* 取消按钮文字
*/
cancelText?: string;
class?: string;
/**
* 是否显示右上角的关闭按钮
* @default true
@@ -31,6 +32,7 @@ export interface DrawerProps {
* 确定按钮文字
*/
confirmText?: string;
contentClass?: string;
/**
* 弹窗描述
*/

View File

@@ -26,14 +26,10 @@ import {
import { cn } from '@vben-core/shared/utils';
interface Props extends DrawerProps {
class?: string;
contentClass?: string;
drawerApi?: ExtendedDrawerApi;
}
const props = withDefaults(defineProps<Props>(), {
class: '',
contentClass: '',
drawerApi: undefined,
});
@@ -44,11 +40,13 @@ const state = props.drawerApi?.useStore?.();
const {
cancelText,
class: drawerClass,
closable,
closeOnClickModal,
closeOnPressEscape,
confirmLoading,
confirmText,
contentClass,
description,
footer: showFooter,
loading: showLoading,
@@ -98,7 +96,7 @@ function pointerDownOutside(e: Event) {
>
<SheetContent
:class="
cn('flex w-[520px] flex-col', props.class, {
cn('flex w-[520px] flex-col', drawerClass, {
'!w-full': isMobile,
})
"