perf: 用户管理-上传头像中弹框关闭立刻销毁内部popover,避免延迟关闭影响用户体验

This commit is contained in:
xiaoxian521
2024-01-16 08:57:56 +08:00
parent ebea78f53b
commit 9f7d49d37a
2 changed files with 17 additions and 2 deletions

View File

@@ -351,6 +351,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
});
}
const cropRef = ref();
/** 上传头像 */
function handleUpload(row) {
addDialog({
@@ -360,6 +361,7 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
closeOnClickModal: false,
contentRenderer: () =>
h(croppingUpload, {
ref: cropRef,
imgSrc: row.avatar,
onCropper: info => (avatarInfo.value = info)
}),
@@ -368,7 +370,8 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
// 根据实际业务使用avatarInfo.value和row里的某些字段去调用上传头像接口即可
done(); // 关闭弹框
onSearch(); // 刷新表格数据
}
},
closeCallBack: () => cropRef.value.hidePopover()
});
}