Skip to content

Popover ​

相对触发器弹出卡片浮层。

Popover 为受控组件:通过 isOpen 控制开关;

使用 ​

ts
import { NxPopover } from "@pc-nexus/angular";
ts
import { NxPopover } from "@pc-nexus/react";

属性 ​

名称类型必填描述
isOpenbooleanY是否打开
triggerAngular:TemplateRef;React:() => ReactNodeY触发器。Angular 传入 ng-template 引用,React 传入渲染函数
placement'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom'打开时相对触发器的位置,默认 bottom

事件 ​

名称类型描述
close() => void关闭浮层时触发事件,React 对应 onClose。业务侧应据此将 isOpen 置为 false

示例 ​

Basic ​

通过 isOpen 控制开关。触发器点击切换开关,Angular 监听 (close),React 使用 onClose,在回调中关闭浮层。子节点组成浮层里的标题和说明。

Placement ​

通过 placement 设置浮层相对触发器的位置,示例为 right。

举报邮箱:abuse@worktile.com