Skip to content

Commit

Permalink
fix(components): fix homeTab closeRight and disable colseLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
Li-0221 committed Mar 18, 2024
1 parent 455e48f commit d28bf52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/layouts/modules/global-tab/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ function getContextMenuDisabledKeys(tabId: string) {
const disabledKeys: App.Global.DropdownKey[] = [];
if (tabStore.isTabRetain(tabId)) {
disabledKeys.push('closeCurrent');
const homeDisable: App.Global.DropdownKey[] = ['closeCurrent', 'closeLeft'];
disabledKeys.push(...homeDisable);
}
return disabledKeys;
Expand Down
6 changes: 6 additions & 0 deletions src/store/modules/tab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,12 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
* @param tabId
*/
async function clearRightTabs(tabId: string) {
const isHomeTab = tabId === homeTab.value?.id;
if (isHomeTab) {
clearTabs();
return;
}

const tabIds = tabs.value.map(tab => tab.id);
const index = tabIds.indexOf(tabId);
if (index === -1) return;
Expand Down

0 comments on commit d28bf52

Please sign in to comment.