* docs(Modal): confim default oktext synch * fix: okText logicpull/6817/head
parent
53dc5daaaf
commit
7bfe30d280
|
@ -88,6 +88,7 @@ export default defineComponent<ConfirmDialogProps>({
|
||||||
onCancel,
|
onCancel,
|
||||||
onOk,
|
onOk,
|
||||||
close,
|
close,
|
||||||
|
okText,
|
||||||
closable = false,
|
closable = false,
|
||||||
zIndex,
|
zIndex,
|
||||||
afterClose,
|
afterClose,
|
||||||
|
@ -141,9 +142,6 @@ export default defineComponent<ConfirmDialogProps>({
|
||||||
const prefixCls = props.prefixCls || 'ant-modal';
|
const prefixCls = props.prefixCls || 'ant-modal';
|
||||||
const contentPrefixCls = `${prefixCls}-confirm`;
|
const contentPrefixCls = `${prefixCls}-confirm`;
|
||||||
const style = attrs.style || {};
|
const style = attrs.style || {};
|
||||||
const okText =
|
|
||||||
renderSomeContent(props.okText) ||
|
|
||||||
(okCancel ? locale.value.okText : locale.value.justOkText);
|
|
||||||
const mergedOkCancel = okCancel ?? type === 'confirm';
|
const mergedOkCancel = okCancel ?? type === 'confirm';
|
||||||
const autoFocusButton =
|
const autoFocusButton =
|
||||||
props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';
|
props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';
|
||||||
|
@ -157,6 +155,8 @@ export default defineComponent<ConfirmDialogProps>({
|
||||||
attrs.class,
|
attrs.class,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const mergedLocal = locale.value;
|
||||||
|
|
||||||
const cancelButton = mergedOkCancel && (
|
const cancelButton = mergedOkCancel && (
|
||||||
<ActionButton
|
<ActionButton
|
||||||
actionFn={onCancel}
|
actionFn={onCancel}
|
||||||
|
@ -165,7 +165,7 @@ export default defineComponent<ConfirmDialogProps>({
|
||||||
buttonProps={cancelButtonProps}
|
buttonProps={cancelButtonProps}
|
||||||
prefixCls={`${rootPrefixCls}-btn`}
|
prefixCls={`${rootPrefixCls}-btn`}
|
||||||
>
|
>
|
||||||
{renderSomeContent(props.cancelText) || locale.value.cancelText}
|
{renderSomeContent(props.cancelText) || mergedLocal.cancelText}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
|
@ -219,7 +219,7 @@ export default defineComponent<ConfirmDialogProps>({
|
||||||
buttonProps={okButtonProps}
|
buttonProps={okButtonProps}
|
||||||
prefixCls={`${rootPrefixCls}-btn`}
|
prefixCls={`${rootPrefixCls}-btn`}
|
||||||
>
|
>
|
||||||
{okText}
|
{okText || (mergedOkCancel ? mergedLocal.okText : mergedLocal.justOkText)}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
Loading…
Reference in New Issue