Merge branch 'main' of https://github.com/vbenjs/vue-vben-admin
This commit is contained in:
@@ -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,
|
||||
|
@@ -7,6 +7,7 @@ export interface DrawerProps {
|
||||
* 取消按钮文字
|
||||
*/
|
||||
cancelText?: string;
|
||||
class?: string;
|
||||
/**
|
||||
* 是否显示右上角的关闭按钮
|
||||
* @default true
|
||||
@@ -31,6 +32,7 @@ export interface DrawerProps {
|
||||
* 确定按钮文字
|
||||
*/
|
||||
confirmText?: string;
|
||||
contentClass?: string;
|
||||
/**
|
||||
* 弹窗描述
|
||||
*/
|
||||
|
@@ -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,
|
||||
})
|
||||
"
|
||||
|
Reference in New Issue
Block a user