mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
refactor: set okText
cancel
defaultValue
This commit is contained in:
parent
b110b8787b
commit
dba62729b0
@ -11,6 +11,7 @@ export default function (props) {
|
||||
let d;
|
||||
props = props || {};
|
||||
props.iconClassName = props.iconClassName || 'question-circle';
|
||||
|
||||
let iconClassType = props.iconClassName;
|
||||
|
||||
let width = props.width || 416;
|
||||
@ -20,6 +21,9 @@ export default function (props) {
|
||||
props.okCancel = true;
|
||||
}
|
||||
|
||||
props.okText = props.okText || (props.okCancel ? '确定' : '知道了');
|
||||
props.cancelText = props.cancelText || '取消';
|
||||
|
||||
function close() {
|
||||
d.setState({
|
||||
visible: false
|
||||
@ -77,16 +81,16 @@ export default function (props) {
|
||||
if (props.okCancel) {
|
||||
footer = <div className="ant-confirm-btns">
|
||||
<Button type="ghost" size="large" onClick={onCancel}>
|
||||
{props.cancelText || '取消'}
|
||||
{props.cancelText}
|
||||
</Button>
|
||||
<Button type="primary" size="large" onClick={onOk}>
|
||||
{props.okText || '确定'}
|
||||
{props.okText}
|
||||
</Button>
|
||||
</div>;
|
||||
} else {
|
||||
footer = <div className="ant-confirm-btns">
|
||||
<Button type="primary" size="large" onClick={onOk}>
|
||||
{props.okText || '知道了'}
|
||||
{props.okText}
|
||||
</Button>
|
||||
</div>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user