tdesign-mobile-vue
Version:
tdesign-mobile-vue
37 lines (36 loc) • 1.06 kB
TypeScript
import { TNode, Styles, AttachNode } from '../common';
export interface TdDrawerProps {
attach?: AttachNode;
closeOnOverlayClick?: boolean;
destroyOnClose?: boolean;
footer?: TNode;
items?: DrawerItem[];
placement?: 'left' | 'right';
showOverlay?: boolean;
title?: string | TNode;
visible?: boolean;
zIndex?: number;
onClose?: (trigger: DrawerTriggerSource) => void;
onItemClick?: (index: number, item: DrawerItem, context: {
e: MouseEvent;
}) => void;
onOverlayClick?: (context: {
e: MouseEvent;
}) => void;
}
export interface DrawerOptions extends Omit<TdDrawerProps, 'attach'> {
className?: string;
style?: string | Styles;
}
export interface DrawerInstance {
destroy?: () => void;
hide?: () => void;
show?: () => void;
update?: (props: DrawerOptions) => void;
}
export interface DrawerItem {
title: string;
icon?: TNode;
}
export declare type DrawerTriggerSource = 'overlay';
export declare type DrawerMethod = (options?: DrawerOptions) => void;