Popover 弹出框
TIP
Popover 组件对应 GvPopover。下方示例可直接交互,点击「显示代码」查看源码。
基础用法
API
Attributes
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| title | 设置触发显示标题 | string | — |
| label | 设置Popover标题 | string | — |
| placement | 设置Popover显示位置 | string | bottom-start |
| trigger | 设置触发显示Popover方式 | string | click |
Events
| 事件名 | 说明 | 类型 |
|---|---|---|
| show | 显示Popover时触发 | () => void |
| hide | 隐藏Popover时触发 | () => void |
定义类型
typescript
// placement 类型
type PlacementType = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
// trigger 类型
type TriggerType = 'click' | 'focus' | 'hover' | 'contextmenu';
// GvPopover props
interface PopoverProps {
title?: string;
label?: string;
placement?: string;
trigger?: string;
}