diff --git a/src/components/ReDialog/index.vue b/src/components/ReDialog/index.vue index 1db105f535..df86143cca 100644 --- a/src/components/ReDialog/index.vue +++ b/src/components/ReDialog/index.vue @@ -15,6 +15,7 @@ defineOptions({ name: "ReDialog" }); +const sureBtnMap = ref({}); const fullscreen = ref(false); const footerButtons = computed(() => { @@ -43,8 +44,21 @@ const footerButtons = computed(() => { bg: true, popconfirm: options?.popconfirm, btnClick: ({ dialog: { options, index } }) => { - const done = () => + if (options?.sureBtnLoading) { + sureBtnMap.value[index] = Object.assign( + {}, + sureBtnMap.value[index], + { + loading: true + } + ); + } + const done = () => { + if (options?.sureBtnLoading) { + sureBtnMap.value[index].loading = false; + } closeDialog(options, index, { command: "sure" }); + }; if (options?.beforeSure && isFunction(options?.beforeSure)) { options.beforeSure(done, { options, index }); } else { @@ -172,6 +186,7 @@ function handleClose(

弹框内容-点击底部确定按钮可开启按钮动画

, + beforeSure: done => { + setTimeout(() => done(), 800); + } + }); +}