React - 如何在 Ant Design Modal 中移除一个按钮
React - How to remove a button in Ant Design Modal
我为我的 React 项目安装了 Ant Design 框架,但我怎么不能从名称“cancle”中删除按钮
我会留一个link给codesandbox and documentation
在文档中使用 footer
自定义页脚按钮栏的道具:
<Modal
visible={visible}
title="Title"
onOk={this.handleOk}
onCancel={this.handleCancel}
footer={[
<Button
key="submit"
type="primary"
loading={loading}
onClick={this.handleOk}
>
Submit
</Button>
]}
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</Modal>
这是一个codesandbox
我为我的 React 项目安装了 Ant Design 框架,但我怎么不能从名称“cancle”中删除按钮
我会留一个link给codesandbox and documentation
在文档中使用 footer
自定义页脚按钮栏的道具:
<Modal
visible={visible}
title="Title"
onOk={this.handleOk}
onCancel={this.handleCancel}
footer={[
<Button
key="submit"
type="primary"
loading={loading}
onClick={this.handleOk}
>
Submit
</Button>
]}
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</Modal>
这是一个codesandbox