0.0.3 • Published 5 years ago
yusei-modal v0.0.3
YUSEI CommonModal
版本
安装
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 | 控制弹窗显示/隐藏 | boolean | false |
loading | 确认按钮loading状态 | boolean | false |
confirmText | 确认按钮显示的文字 | string | false |
cancelText | 取消按钮显示的文字 | string | false |
disabled | 确认按钮是否可点击 | boolean | false |
isShowConfirmBtn | 是否显示确认按钮 | boolean | true |
isShowCancleBtn | 是否显示取消按钮 | boolean | true |
footer | 底部 | Node / boolean | false |
onHandleConfirm | 确认按钮的回调 | () => void | false |
onHandleCancel | 取消按钮的回调 | () => void | false |
confirmBtnType | 确认按钮的类型(与antd的Button type属性一致 ) | string | false |
cancleBtnType | 取消按钮的类型(与antd的Button type属性一致 ) | string | false |
children | 弹窗显示的内容 | any | false |