vuux
Version:
Vue3 Nuxt3 Nuxt4 组件库
52 lines (51 loc) • 1.07 kB
TypeScript
/**
* 类型
*/
type DialogType = 'success' | 'warning' | 'info' | 'error' | string;
/**
* 对话框
*/
declare class Dialog {
/**
* 标记是否已有对话框存在
*/
private static isOpen;
/**
* 创建对话框元素
*
* @param options 配置项
*/
private static createDialog;
/**
* 添加对话框到页面
*/
private static add;
/**
* 从页面移除对话框
*/
private static remove;
/**
* @description 确认对话框
*
* @param options 字符串或对象
*/
static confirm(options?: string | {
title?: string;
content?: string;
confirmText?: string;
cancelText?: string;
type?: DialogType;
}): Promise<boolean>;
/**
* @description 提示对话框
*
* @param options 字符串或对象
*/
static alert(options: string | {
title?: string;
content?: string;
confirmText?: string;
type?: DialogType;
}): Promise<void>;
}
export default Dialog;