mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-07 02:07:40 +08:00
fix: code editor tab close (#8863)
This commit is contained in:
parent
1771bc7dc8
commit
a4d63434cb
1 changed files with 5 additions and 4 deletions
|
|
@ -466,9 +466,8 @@ const removeTab = (targetPath: TabPaneName) => {
|
|||
getContent(selectTab.value, '');
|
||||
})
|
||||
.catch(() => {
|
||||
isEdit.value = false;
|
||||
editor.setValue(oldFileContent.value);
|
||||
updateTabs();
|
||||
isEdit.value = false;
|
||||
if (fileTabs.value.length > 0) {
|
||||
getContent(selectTab.value, '');
|
||||
}
|
||||
|
|
@ -512,8 +511,10 @@ const removeAllTab = (targetPath: string, type: 'left' | 'right' | 'all') => {
|
|||
};
|
||||
|
||||
const onCancel = () => {
|
||||
if (type === 'left' || type === 'right') {
|
||||
editor.setValue(oldFileContent.value);
|
||||
}
|
||||
isEdit.value = false;
|
||||
editor.setValue(oldFileContent.value);
|
||||
updateTabs();
|
||||
};
|
||||
|
||||
|
|
@ -550,8 +551,8 @@ const removeOtherTab = (targetPath: string) => {
|
|||
};
|
||||
|
||||
const onCancel = () => {
|
||||
isEdit.value = false;
|
||||
editor.setValue(oldFileContent.value);
|
||||
isEdit.value = false;
|
||||
updateTabs();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue