mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-11-29 18:48:32 +08:00
* docs(Modal): confim default oktext synch * fix: okText logic
This commit is contained in:
parent
53dc5daaaf
commit
7bfe30d280
@ -88,6 +88,7 @@ export default defineComponent<ConfirmDialogProps>({
|
||||
onCancel,
|
||||
onOk,
|
||||
close,
|
||||
okText,
|
||||
closable = false,
|
||||
zIndex,
|
||||
afterClose,
|
||||
@ -141,9 +142,6 @@ export default defineComponent<ConfirmDialogProps>({
|
||||
const prefixCls = props.prefixCls || 'ant-modal';
|
||||
const contentPrefixCls = `${prefixCls}-confirm`;
|
||||
const style = attrs.style || {};
|
||||
const okText =
|
||||
renderSomeContent(props.okText) ||
|
||||
(okCancel ? locale.value.okText : locale.value.justOkText);
|
||||
const mergedOkCancel = okCancel ?? type === 'confirm';
|
||||
const autoFocusButton =
|
||||
props.autoFocusButton === null ? false : props.autoFocusButton || 'ok';
|
||||
@ -157,6 +155,8 @@ export default defineComponent<ConfirmDialogProps>({
|
||||
attrs.class,
|
||||
);
|
||||
|
||||
const mergedLocal = locale.value;
|
||||
|
||||
const cancelButton = mergedOkCancel && (
|
||||
<ActionButton
|
||||
actionFn={onCancel}
|
||||
@ -165,7 +165,7 @@ export default defineComponent<ConfirmDialogProps>({
|
||||
buttonProps={cancelButtonProps}
|
||||
prefixCls={`${rootPrefixCls}-btn`}
|
||||
>
|
||||
{renderSomeContent(props.cancelText) || locale.value.cancelText}
|
||||
{renderSomeContent(props.cancelText) || mergedLocal.cancelText}
|
||||
</ActionButton>
|
||||
);
|
||||
return (
|
||||
@ -219,7 +219,7 @@ export default defineComponent<ConfirmDialogProps>({
|
||||
buttonProps={okButtonProps}
|
||||
prefixCls={`${rootPrefixCls}-btn`}
|
||||
>
|
||||
{okText}
|
||||
{okText || (mergedOkCancel ? mergedLocal.okText : mergedLocal.justOkText)}
|
||||
</ActionButton>
|
||||
</div>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user