Merge pull request #352 from Li-0221/main
fix(components): fix homeTab closeRight and disable colseLeft
This commit is contained in:
commit
51d7758903
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user