Skip to content

Commit

Permalink
fix(projects): 修复tab不显示路由首页的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Jun 27, 2022
1 parent 973ab14 commit a792bb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/store/modules/tab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ export const useTabStore = defineStore('tab-store', {
if (!isHome) {
const currentTab = getTabRouteByVueRoute(currentRoute);
if (!currentRoute.meta.multiTab) {
tabs.splice(index, 1, currentTab);
if (index > -1) {
tabs.splice(index, 1, currentTab);
} else {
tabs.push(currentTab);
}
} else {
const hasCurrent = isInTabRoutes(tabs, currentRoute.fullPath);
if (!hasCurrent) {
Expand Down

1 comment on commit a792bb5

@vercel
Copy link

@vercel vercel bot commented on a792bb5 Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.