Skip to content

Commit

Permalink
fix: only add page type tab into tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
shilohooo committed Jan 12, 2025
1 parent 637bc4e commit 8559e1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/tab.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { HOME_MENU, type Menu } from 'src/router/routes/menu.data'
import { HOME_MENU, type Menu, MenuType } from 'src/router/routes/menu.data'

export type Tab = Menu & { closable?: boolean }

Expand All @@ -18,6 +18,10 @@ export const useTabStore = defineStore('tab-store', () => {
* @date 2024/7/24 15:47
*/
const addTab = (tab: Tab) => {
if (MenuType.PAGE !== tab.type) {
return
}

const index = tabs.value.findIndex((item) => item.path === tab.path)
if (index > -1) {
return
Expand Down

0 comments on commit 8559e1b

Please sign in to comment.