iview/types/modal.d.ts

225 lines
5.3 KiB
TypeScript
Raw Normal View History

2018-08-31 18:04:17 +08:00
// Type definitions for iview 3.1.0
// Project: https://github.com/iview/iview
// Definitions by: yangdan
// Definitions: https://github.com/yangdan8/iview.git
import Vue, { VNode, CreateElement } from "vue";
export declare interface Modal {
/**
* 使 v-model
* @default false
*/
value?: boolean;
/**
* 使 slot title
*/
title?: string;
/**
* Esc ,
* @default true
*/
closable?: boolean;
/**
*
* @default true
*/
"mask-closable"?: boolean;
/**
* loading visible来关闭对话框,
* @default false
*/
loading?: boolean;
/**
*
* @default false
*/
scrollable?: boolean;
/**
*
* @default false
*/
fullscreen?: boolean;
/**
*
* @default false
*/
draggable?: boolean;
/**
* draggable
* @default true
*/
mask?: boolean;
/**
*
* @default
*/
"ok-text"?: string;
/**
*
* @default
*/
"cancel-text"?: string;
/**
* px
* 768px auto,
* @default 520
*/
width?: number | string;
/**
*
* @default false
*/
"footer-hide"?: boolean;
/**
* .ivu-modal的样式
*/
style?: object;
/**
* .ivu-modal-wrap的类名
*/
"class-name"?: string;
/**
*
* @default 1000
*/
"z-index"?: number;
/**
* ,
* @default ['ease', 'fade']
*/
"transition-names"?: Array<string>;
/**
* body true
* @default true
*/
transfer?: boolean;
/**
*
*/
$emit(eventName: "on-ok"): this;
/**
*
*/
$emit(eventName: "on-cancel"): this;
/**
*
*/
$emit(eventName: "on-visible-change", visible: boolean): this;
/**
* slot插槽对象
*/
$slots: {
/**
*
*/
"": VNode[];
/**
*
*/
header: VNode[];
/**
*
*/
footer: VNode[];
/**
*
*/
close: VNode[];
};
}
export declare interface ModalInstance {
/**
*
* @param config ModalConfig为相关配置,string为待显示的内容
*/
info(config?: ModalConfig | string): void;
/**
*
* @param config ModalConfig为相关配置,string为待显示的内容
*/
success(config?: ModalConfig | string): void;
/**
*
* @param config ModalConfig为相关配置,string为待显示的内容
*/
warning(config?: ModalConfig | string): void;
/**
*
* @param config ModalConfig为相关配置,string为待显示的内容
*/
error(config?: ModalConfig | string): void;
/**
*
* @param config ModalConfig为相关配置,string为待显示的内容
*/
confirm(config?: ModalConfig | string): void;
/**
*
*/
remove(): void;
}
export declare interface ModalConfig {
/**
* Element选择器字符串
*/
title?: string;
/**
* Element选择器字符串
*/
content?: string;
/**
* 使 content
* @param h Render函数
*/
render?: (h?: CreateElement) => void;
/**
* px
* @default 416
*/
width?: number | string;
/**
*
* @default
*/
okText?: string;
/**
* Modal.confirm()
* @default
*/
cancelText?: string;
/**
* loading Modal.remove()
* @default false
*/
loading?: boolean;
/**
*
* @default false
*/
scrollable?: boolean;
/**
*
* @default false
*/
closable?: boolean;
/**
*
*/
onOk?: () => void;
/**
* Modal.confirm()
*/
onCancel?: () => void;
}
declare module "vue/types/vue" {
interface Vue {
/**
*
*/
$Modal: ModalInstance;
}
2018-11-09 17:06:05 +08:00
}