feat: ReDialog组件的确定按钮提供关闭按钮动画closeLoading功能

This commit is contained in:
xiaoxian521
2024-08-05 13:15:10 +08:00
parent 37ab40f188
commit 96152ed134
3 changed files with 17 additions and 9 deletions

View File

@@ -53,14 +53,17 @@ const footerButtons = computed(() => {
}
);
}
const done = () => {
const closeLoading = () => {
if (options?.sureBtnLoading) {
sureBtnMap.value[index].loading = false;
}
};
const done = () => {
closeLoading();
closeDialog(options, index, { command: "sure" });
};
if (options?.beforeSure && isFunction(options?.beforeSure)) {
options.beforeSure(done, { options, index });
options.beforeSure(done, { options, index, closeLoading });
} else {
done();
}