mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-11 00:54:55 +08:00
feat: confirm before leaving during file upload (#10143)
This commit is contained in:
parent
283609cf2d
commit
ca84909716
1 changed files with 12 additions and 0 deletions
|
@ -448,6 +448,18 @@ const acceptParams = (props: UploadFileProps) => {
|
|||
});
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('beforeunload', (e) => {
|
||||
if (upLoading.value) {
|
||||
if (upLoading.value) {
|
||||
e.preventDefault();
|
||||
e.returnValue = i18n.global.t('file.cancelUploadHelper');
|
||||
return i18n.global.t('file.cancelUploadHelper');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
defineExpose({ acceptParams, handleDrop, open });
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue