mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
types: fix teleport typing #7687
This commit is contained in:
parent
9eda920504
commit
52384aba1e
3
types/dialog.d.ts
vendored
3
types/dialog.d.ts
vendored
@ -1,4 +1,5 @@
|
||||
import { VanComponent } from './component';
|
||||
import { TeleportProps } from 'vue';
|
||||
|
||||
type DialogAction = 'confirm' | 'cancel';
|
||||
type DialogDone = (close?: boolean) => void;
|
||||
@ -9,6 +10,7 @@ export type DialogOptions = {
|
||||
message?: string;
|
||||
theme?: string;
|
||||
overlay?: boolean;
|
||||
teleport?: TeleportProps['to'];
|
||||
className?: any;
|
||||
allowHtml?: boolean;
|
||||
lockScroll?: boolean;
|
||||
@ -24,7 +26,6 @@ export type DialogOptions = {
|
||||
showConfirmButton?: boolean;
|
||||
showCancelButton?: boolean;
|
||||
closeOnClickOverlay?: boolean;
|
||||
getContainer?: string | (() => Element);
|
||||
beforeClose?: (action: DialogAction, done: DialogDone) => void;
|
||||
};
|
||||
|
||||
|
3
types/image-preview.d.ts
vendored
3
types/image-preview.d.ts
vendored
@ -1,3 +1,4 @@
|
||||
import { TeleportProps } from 'vue';
|
||||
import { VanComponent } from './component';
|
||||
import { SwipeToOptions } from './swipe';
|
||||
|
||||
@ -8,6 +9,7 @@ export type ImagePreviewOptions =
|
||||
images: string[];
|
||||
maxZoom?: number;
|
||||
minZoom?: number;
|
||||
teleport?: TeleportProps['to'];
|
||||
className?: any;
|
||||
showIndex?: boolean;
|
||||
closeable?: boolean;
|
||||
@ -18,7 +20,6 @@ export type ImagePreviewOptions =
|
||||
showIndicators?: boolean;
|
||||
closeOnPopstate?: boolean;
|
||||
closeIconPosition?: string;
|
||||
getContainer?: string | (() => Element);
|
||||
onClose?(): void;
|
||||
onChange?(index: number): void;
|
||||
swipeTo?(index: number, options?: SwipeToOptions): void;
|
||||
|
4
types/toast.d.ts
vendored
4
types/toast.d.ts
vendored
@ -1,3 +1,5 @@
|
||||
import { TeleportProps } from 'vue';
|
||||
|
||||
type ToastMessage = string | number;
|
||||
type ToastType = 'text' | 'loading' | 'success' | 'fail' | 'html';
|
||||
type ToastPosition = 'top' | 'middle' | 'bottom';
|
||||
@ -12,6 +14,7 @@ export type ToastOptions = {
|
||||
onOpened?: () => void;
|
||||
overlay?: boolean;
|
||||
duration?: number;
|
||||
teleport?: TeleportProps['to'];
|
||||
position?: ToastPosition;
|
||||
className?: any;
|
||||
transition?: string;
|
||||
@ -20,7 +23,6 @@ export type ToastOptions = {
|
||||
forbidClick?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
closeOnClickOverlay?: boolean;
|
||||
getContainer?: string | (() => Element);
|
||||
};
|
||||
|
||||
export interface VanToast {
|
||||
|
Loading…
x
Reference in New Issue
Block a user