UNPKG

@extclp/vexip-ui

Version:

A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good

27 lines (26 loc) 805 B
import { ComponentPublicInstance, MaybeRef } from 'vue'; import { MaybeInstance } from '@vexip-ui/hooks'; export type Key = string | number; export interface ContextmenuConfig { key: Key; label?: string; icon?: Record<string, unknown> | (() => any); color?: string; iconColor?: string; shortcut?: string; divided?: boolean; disabled?: boolean; children?: ContextmenuConfig[]; renderer?: () => any; } export interface ContextmenuOptions { clientX: number; clientY: number; configs: ContextmenuConfig[]; target?: MaybeRef<string | MaybeInstance>; appear?: boolean; } export interface ContextmenuInstance extends ComponentPublicInstance { openContextmenu: (options: ContextmenuOptions) => Promise<Key[] | null>; handleCancel: () => void; }