For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/zh/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/zh/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/zh/components/popconfirm.md.
v0.0.57
  • 简体中文
  • Popconfirm

    反馈@rockshin/tao-ui

    在触发器附近确认一个简短且有风险的操作。

    何时使用

    删除、离开或覆盖等操作需要轻量确认时使用 Popconfirm。

    推荐

    • 标题直接说明将要发生的动作。
    • 不可逆后果放入说明。

    避免

    • 复杂决策或大量说明应使用 Modal。

    代码演示

    基础用法

    TSX

    说明与自定义文案

    TSX

    按钮属性与禁用状态

    TSX

    确认与取消反馈

    明确处理两个回调,在页面内显示用户选择。

    No decision yet
    TSX

    条件禁用

    disabled 阻止弹层打开,独立开关演示可操作条件。

    TSX

    位置与图标

    placement 设定初始方向,icon=null 可隐藏默认警告图标。

    TSX

    API

    Popconfirm

    属性说明类型默认值
    titleMain question text of the confirm popup (required, antd parity).ReactNode (必填)-
    descriptionSecondary text shown under the title.ReactNode-
    onConfirmCalled when OK is clicked; the popup also closes.((e?: MouseEvent<HTMLElement, MouseEvent> | undefined) => void) | undefined-
    onCancelCalled when Cancel is clicked; the popup also closes.((e?: MouseEvent<HTMLElement, MouseEvent> | undefined) => void) | undefined-
    okTextText of the OK button. Defaults to 'OK'.ReactNode-
    cancelTextText of the Cancel button. Defaults to 'Cancel'.ReactNode-
    okButtonPropsExtra props forwarded to the OK button.ButtonProps | undefined-
    cancelButtonPropsExtra props forwarded to the Cancel button.ButtonProps | undefined-
    iconIcon shown before the title. Defaults to a warning triangle; pass null to hide it.ReactNode-
    disabledWhen true, the trigger still renders but the popup never opens.boolean | undefined-
    placementPopup side relative to the trigger. Defaults to 'top'.PopoverPlacement | undefinedtop
    classNameMerged onto the confirm content wrapper.string | undefined-
    style节点样式CSSProperties | undefined-
    childrenExactly one trigger element.ReactNode (必填)-