【问题标题】:How to hide the X button present at the top from the antd modal如何从 antd modal 隐藏顶部的 X 按钮
【发布时间】:2021-01-21 09:09:40
【问题描述】:

如何从 ant d 模态框隐藏顶部的 X 按钮,以及如何禁用使用 ESC 键关闭模态框的行为

return (
<Modal
title={modalHeader}
okText="EXIT"
cancelText="CONTINUE"
visible={visible}
onCancel={onCancelHandler}
onOk={exitUser}
width={600}
cancelButtonProps={{hidden:isExFlag}}
>
<DescriptionParagraph>
{modalBodyText}
</DescriptionParagraph>
</Modal>
);

【问题讨论】:

    标签: antd ant-design-pro react-typescript


    【解决方案1】:

    基于documentation版本4.6.6

    要从 ant d modal 中隐藏顶部的 X 按钮,请使用 prop closable

    <Modal closable={false}>...</Modal>
    

    要禁用使用 esc 键关闭模式的行为,请使用 prop keyboard

    <Modal keyboard={false}>...</Modal>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-07
      • 1970-01-01
      • 1970-01-01
      • 2011-11-10
      • 2022-01-15
      • 2017-05-22
      相关资源
      最近更新 更多