birt
2025-04-13 b0530ed9211230227a8f94e394eda779d5ae5fc1
zhitan-vue/src/router/index.js
@@ -1,6 +1,7 @@
import { createWebHistory, createRouter } from 'vue-router'
/* Layout */
import Layout from '@/layout'
import useAppStore from '@/store/modules/app'
/**
 * Note: 路由配置项
@@ -66,7 +67,13 @@
        path: '/index',
        component: () => import('@/views/index'),
        name: 'Index',
        meta: { title: '首页', icon: 'dashboard', affix: true }
        meta: { title: '首页', icon: 'dashboard', affix: true, showSidebar: true, breadcrumb: false },
        beforeEnter: (to, from, next) => {
          // 获取app store并设置侧边栏为折叠状态
          const appStore = useAppStore()
          appStore.showCollapsedSidebar()
          next()
        }
      }
    ]
  },