export type PopoverValue = string; export interface PopoverProps { visible?: boolean; /** * 禁用 */ disabled?: boolean; /** * 触发方式 */ trigger?: 'control' | 'click' | 'focus' | 'hover' | 'contextmenu'; /** * 标题 */ title?: string; /** * 弹框宽度 */ width?: number; /** * 出现位置 */ placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'; } export interface PopoverEmits { /** * 需要手动定义 不然类型推导会报错 */ (e: 'update:visible', value: boolean): void; /** * 显示时触发 */ (e: 'show'): void; /** * 隐藏时触发 */ (e: 'hide'): void; /** * 点击内容以外的地方, 手动控制显隐是可以实现点击别处关闭 */ (e: 'clickOutside'): void; } export type PopoverSlots = { /** * 提示内容 */ default: (props: any) => any; /** * 触发插槽 */ reference: () => void; };