@@ -88,6 +88,7 @@ export default defineComponent<ConfirmDialogProps>({
88
88
onCancel,
89
89
onOk,
90
90
close,
91
+ okText,
91
92
closable = false ,
92
93
zIndex,
93
94
afterClose,
@@ -141,9 +142,6 @@ export default defineComponent<ConfirmDialogProps>({
141
142
const prefixCls = props . prefixCls || 'ant-modal' ;
142
143
const contentPrefixCls = `${ prefixCls } -confirm` ;
143
144
const style = attrs . style || { } ;
144
- const okText =
145
- renderSomeContent ( props . okText ) ||
146
- ( okCancel ? locale . value . okText : locale . value . justOkText ) ;
147
145
const mergedOkCancel = okCancel ?? type === 'confirm' ;
148
146
const autoFocusButton =
149
147
props . autoFocusButton === null ? false : props . autoFocusButton || 'ok' ;
@@ -157,6 +155,8 @@ export default defineComponent<ConfirmDialogProps>({
157
155
attrs . class ,
158
156
) ;
159
157
158
+ const mergedLocal = locale . value ;
159
+
160
160
const cancelButton = mergedOkCancel && (
161
161
< ActionButton
162
162
actionFn = { onCancel }
@@ -165,7 +165,7 @@ export default defineComponent<ConfirmDialogProps>({
165
165
buttonProps = { cancelButtonProps }
166
166
prefixCls = { `${ rootPrefixCls } -btn` }
167
167
>
168
- { renderSomeContent ( props . cancelText ) || locale . value . cancelText }
168
+ { renderSomeContent ( props . cancelText ) || mergedLocal . cancelText }
169
169
</ ActionButton >
170
170
) ;
171
171
return (
@@ -219,7 +219,7 @@ export default defineComponent<ConfirmDialogProps>({
219
219
buttonProps = { okButtonProps }
220
220
prefixCls = { `${ rootPrefixCls } -btn` }
221
221
>
222
- { okText }
222
+ { okText || ( mergedOkCancel ? mergedLocal . okText : mergedLocal . justOkText ) }
223
223
</ ActionButton >
224
224
</ div >
225
225
) }
0 commit comments