[new feature] Dialog: add getContainer option (#3040)

This commit is contained in:
neverland
2019-03-22 15:13:30 +08:00
committed by GitHub
parent 5a44d204bd
commit c1adaebaa6
9 changed files with 25 additions and 22 deletions
+3 -2
View File
@@ -13,8 +13,9 @@ export type DialogOptions = {
showConfirmButton?: boolean;
showCancelButton?: boolean;
closeOnClickOverlay?: boolean;
getContainer?: string | (() => HTMLElement);
beforeClose?: (action: DialogAction, done: DialogDone) => void;
}
};
export interface Dialog {
(options: DialogOptions): Promise<DialogAction>;
@@ -28,7 +29,7 @@ export interface Dialog {
declare module 'vue/types/vue' {
interface Vue {
$dialog: Dialog
$dialog: Dialog;
}
}
+6 -5
View File
@@ -13,7 +13,8 @@ export type ToastOptions = {
forbidClick?: boolean;
loadingType?: string;
message?: ToastMessage;
}
getContainer?: string | (() => HTMLElement);
};
export interface VanToast extends Vue, VanPopupMixin {
type: string;
@@ -24,7 +25,7 @@ export interface VanToast extends Vue, VanPopupMixin {
clear(): void;
}
export interface IToast {
export interface Toast {
(message: ToastOptions | ToastMessage, options?: ToastOptions): VanToast;
loading(options?: ToastOptions | ToastMessage): VanToast;
success(options?: ToastOptions | ToastMessage): VanToast;
@@ -33,13 +34,13 @@ export interface IToast {
install(): void;
setDefaultOptions(options: ToastOptions): void;
resetDefaultOptions(): void;
allowMultiple(allow: boolean): void
allowMultiple(allow: boolean): void;
}
declare module 'vue/types/vue' {
interface Vue {
$toast: IToast
$toast: Toast;
}
}
export const Toast: IToast;
export const Toast: Toast;
+1 -1
View File
@@ -2,7 +2,7 @@ import { DirectiveFunction, PluginFunction } from 'vue';
export interface Waterfall {
(type: string): DirectiveFunction;
install: PluginFunction<void>
install: PluginFunction<void>;
}
export const Waterfall: Waterfall;