0.0.3 • Published 5 years ago

yusei-modal v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

YUSEI CommonModal

版本

npm version

安装

npm install yusei-commonmodal --save

使用

import YuseiCommonmodal from 'yusei-commonmodal';

class Button extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      isModalShow: false,
    }
  }
  handleShow = () => {
    this.setState({
      isModalShow: true,
    })
  }
  handleCancel= () => {
    this.setState({
      isModalShow: false,
    })
  }
  render() {
    const { isModalShow } = this.state;
    return (
      <div className="container">
        <button type="button" onClick={() => this.handleShow()}>show modal</button>
        <YuseiCommonmodal 
          title="test"
          visible={isModalShow}
          onHandleCancel={() => this.handleCancel()}
          isShowConfirmBtn={false}
        >
          <div>test</div>
        </YuseiCommonmodal>
      </div>
    );
  }
}

属性

属性简介类型默认值
style自定义样式object
title弹窗标题number标题
visible控制弹窗显示/隐藏booleanfalse
loading确认按钮loading状态booleanfalse
confirmText确认按钮显示的文字stringfalse
cancelText取消按钮显示的文字stringfalse
disabled确认按钮是否可点击booleanfalse
isShowConfirmBtn是否显示确认按钮booleantrue
isShowCancleBtn是否显示取消按钮booleantrue
footer底部Node / booleanfalse
onHandleConfirm确认按钮的回调() => voidfalse
onHandleCancel取消按钮的回调() => voidfalse
confirmBtnType确认按钮的类型(与antd的Button type属性一致 )stringfalse
cancleBtnType取消按钮的类型(与antd的Button type属性一致 )stringfalse
children弹窗显示的内容anyfalse
0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago