美文网首页
react antd 自定义 Modal的 确认和取消按钮

react antd 自定义 Modal的 确认和取消按钮

作者: lessonSam | 来源:发表于2020-07-08 10:56 被阅读0次
    使用Modal中的footer属性,如下:
    
    <Modal
    title="更改成员"
    visible={visible}
    confirmLoading={confirmLoading}
    onCancel={this.handleCancel}
    footer={
    [] // 设置footer为空,去掉 取消 确定默认按钮
    }
    >
    
    </Modal>
    这样就去掉了确认和取消按钮
    
     
    
    也可以自定义按钮。如下:
    
    <Modal
    visible={visible}
    title="Title"
    onOk={this.handleOk}
    onCancel={this.handleCancel}
    footer={[
    // 定义右下角 按钮的地方 可根据需要使用 一个或者 2个按钮
    <Button key="back" onClick={this.handleCancel}></Button>,
    <Button key="submit" type="primary" loading={loading} onClick={this.handleOk}>
    Submit
    </Button>, ]}
    >
    
    </Modal>
    

    相关文章

      网友评论

          本文标题:react antd 自定义 Modal的 确认和取消按钮

          本文链接:https://www.haomeiwen.com/subject/tsvqcktx.html