Skip to content

Popover 弹出框

TIP

Popover 组件对应 GvPopover。下方示例可直接交互,点击「显示代码」查看源码。

基础用法

API

Attributes

属性名说明类型默认值
title设置触发显示标题string
label设置Popover标题string
placement设置Popover显示位置stringbottom-start
trigger设置触发显示Popover方式stringclick

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;
}