Antd Modal弹框自定义按钮数量和样式
Antd的Modal组件默认按钮只有确认、取消两个。
footer 底部内容,当不需要默认底部按钮时,可以设为 footer={null}string|ReactNode 确定取消按钮
该属性支持ReactNode。
F12拷贝的原有按钮样式。
<Modal
onCancel={隐藏}
footer={[
<button type="button" class="ant-btn"><span>取 消</span></button>,
<button type="button" class="ant-btn ant-btn-primary"><span>确 认</span></button>
]}
></Modal>
注:当自定义按钮时,Modal上的onCancel属性不可缺失。因为右上角还有个关闭按钮。

浙公网安备 33010602011771号