ant-design/components/popover/index.zh-CN.md
Wanpan 50da162d8b
Some checks are pending
Publish Any Commit / build (push) Waiting to run
✅ test v6 / lint (push) Waiting to run
✅ test v6 / test-react-legacy (18, 1/2) (push) Waiting to run
✅ test v6 / test-react-legacy (18, 2/2) (push) Waiting to run
✅ test v6 / test-node (push) Waiting to run
✅ test v6 / test-react-latest (dom, 1/2) (push) Waiting to run
✅ test v6 / test-react-latest (dom, 2/2) (push) Waiting to run
✅ test v6 / test-react-latest-dist (dist, 1/2) (push) Blocked by required conditions
✅ test v6 / test-react-latest-dist (dist, 2/2) (push) Blocked by required conditions
✅ test v6 / test-react-latest-dist (dist-min, 1/2) (push) Blocked by required conditions
✅ test v6 / test-react-latest-dist (dist-min, 2/2) (push) Blocked by required conditions
✅ test v6 / test-coverage (push) Blocked by required conditions
✅ test v6 / build (push) Waiting to run
✅ test v6 / test lib/es module (es, 1/2) (push) Waiting to run
✅ test v6 / test lib/es module (es, 2/2) (push) Waiting to run
✅ test v6 / test lib/es module (lib, 1/2) (push) Waiting to run
✅ test v6 / test lib/es module (lib, 2/2) (push) Waiting to run
👁️ Visual Regression Persist Start / test image (push) Waiting to run
fix: replace rc-tooltip deprecated api (#52395)
* chore: add rc-tooltip

* chore: rename

* fix: remove deprecated api

* fix: update

* test: snap

* fix: update

* Update components/cascader/__tests__/index.test.tsx

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: Wanpan <wanpan96@163.com>

* Update components/cascader/__tests__/index.test.tsx

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: Wanpan <wanpan96@163.com>

* Update components/cascader/__tests__/index.test.tsx

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: Wanpan <wanpan96@163.com>

---------

Signed-off-by: Wanpan <wanpan96@163.com>
Co-authored-by: thinkasany <480968828@qq.com>
2025-01-15 23:17:18 +08:00

2.4 KiB
Raw Blame History

category group title subtitle description cover coverDark demo
Components 数据展示 Popover 气泡卡片 点击/鼠标移入元素,弹出气泡式的卡片浮层。 https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*kfW5RrfF4L8AAAAAAAAAAAAADrJ8AQ/original https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*6b8fSKVVtXIAAAAAAAAAAAAADrJ8AQ/original
cols
2

何时使用

当目标元素有进一步的描述和相关操作时,可以收纳到卡片中,根据用户的操作行为进行展现。

Tooltip 的区别是,用户可以对浮层上的元素进行操作,因此它可以承载更复杂的内容,比如链接或按钮等。

代码演示

基本 三种触发方式 位置 箭头展示 Arrow.pointAtCenter 贴边偏移 从浮层内关闭 悬停点击弹出窗口 _InternalPanelDoNotUseOrYouWillBeFired 线框风格 组件 Token

API

通用属性参考:通用属性

参数 说明 类型 默认值 版本
content 卡片内容 ReactNode | () => ReactNode -
title 卡片标题 ReactNode | () => ReactNode -

注意

请确保 Popover 的子元素能接受 onMouseEnteronMouseLeaveonFocusonClick 事件。

Semantic DOM

主题变量Design Token

FAQ

为何有时候 HOC 组件无法生效?

请确保 Popover 的子元素能接受 onMouseEnteronMouseLeaveonPointerEnteronPointerLeaveonFocusonClick 事件。

更多问题,请参考 Tooltip FAQ