iview/types/modal.d.ts

218 lines
4.7 KiB
TypeScript
Raw Normal View History

2018-08-30 13:27:15 +08:00
// Type definitions for iview 3.0.1
// Project: https://github.com/iview/iview
// Definitions by: yangdan
// Definitions: https://github.com/yangdan8/iview.git
2018-08-30 16:45:58 +08:00
import Vue from 'vue';
2018-08-30 13:27:15 +08:00
export declare class 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 ['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[];
};
}
2018-08-30 13:27:15 +08:00
export declare class 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;
}
2018-08-30 13:27:15 +08:00
export declare class ModalConfig {
/**
* Element选择器字符串
*/
title?: string;
/**
* Element选择器字符串
*/
content?: string;
/**
* 使 content
*/
render?: () => 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;
}
}