fix: 打开历史目录时关闭所有标签页

在打开历史目录前先调用 closeAllTabs 方法,避免历史目录内容与当前标签页内容冲突
This commit is contained in:
cfq 2026-01-30 16:41:19 +08:00
parent 4a6810e57b
commit b952be4c4a
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import GitPanel from "./components/GitPanel.vue";
import { useFileTree } from "./composables/useFileTree"; import { useFileTree } from "./composables/useFileTree";
import { useConfig } from "./composables/useConfig"; import { useConfig } from "./composables/useConfig";
import { useTheme } from "./composables/useTheme"; import { useTheme } from "./composables/useTheme";
import { useTabs } from "./composables/useTabs";
import { ConfigProvider } from 'ant-design-vue'; import { ConfigProvider } from 'ant-design-vue';
import { SettingOutlined, DeleteOutlined, FolderOpenOutlined } from '@ant-design/icons-vue'; import { SettingOutlined, DeleteOutlined, FolderOpenOutlined } from '@ant-design/icons-vue';
@ -26,6 +27,7 @@ const {
setFontFamily, setFontFamily,
setCodeFontFamily setCodeFontFamily
} = useTheme(); } = useTheme();
const { closeAllTabs } = useTabs();
const route = ref(""); const route = ref("");
const showSearch = ref(false); const showSearch = ref(false);
@ -231,6 +233,7 @@ const removeHistoryDir = async (path) => {
}; };
const handleHistorySelect = (path) => { const handleHistorySelect = (path) => {
closeAllTabs();
openDirectory(path); openDirectory(path);
showHistory.value = false; showHistory.value = false;
}; };