sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
41 lines (40 loc) • 1.29 kB
TypeScript
import { type StyleValue } from 'vue';
import { type DefaultProps } from '../config';
import { type ButtonProps } from '../button';
import { type TransitionHookEmits } from '../popup/common';
export type DialogBeforeClose = (type: 'close' | 'cancel' | 'confirm', loading: {
readonly cancel: boolean;
readonly confirm: boolean;
readonly close: boolean;
}) => any | Promise<any>;
export interface DialogProps {
rootStyle?: StyleValue;
rootClass?: string;
popupStyle?: StyleValue;
popupClass?: string;
visible?: boolean;
title?: string;
message?: string;
headed?: boolean;
buttonType?: 'round' | 'text';
showCancel?: boolean;
cancelText?: string;
showConfirm?: boolean;
confirmText?: string;
overlayClosable?: boolean;
beforeClose?: DialogBeforeClose;
duration?: number;
cancelProps?: ButtonProps;
confirmProps?: ButtonProps;
backPress?: 'close' | 'back';
}
export declare const defaultDialogProps: () => DefaultProps<DialogProps>;
export interface DialogSlots {
default?(props: Record<string, never>): any;
}
export interface DialogEmits extends TransitionHookEmits {
(e: 'update:visible', visible: boolean): void;
(e: 'close'): void;
(e: 'cancel'): void;
(e: 'confirm'): void;
}