This commit is contained in:
gyq 2025-09-10 14:15:38 +08:00
commit 2710f276e3
3 changed files with 6 additions and 8 deletions

View File

@ -29,11 +29,7 @@
</el-menu-item>
</AppLink>
</template>
<template
v-else-if="
item.children && item.children.length == 1 && hasOneShowingChild(item.children, item)
"
>
<template v-else-if="item.children && hasOneShowingChild(item.children, item)">
<AppLink
v-if="onlyOneChild.meta"
:to="{
@ -124,7 +120,6 @@ function hasOneShowingChild(children: RouteRecordRaw[] = [], parent: RouteRecord
//
const showingChildren = children.filter((route: RouteRecordRaw) => {
if (!route.meta?.hidden) {
console.log(route);
onlyOneChild.value = route;
return true;
}

View File

@ -1,5 +1,5 @@
import type { App } from "vue";
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
import { createRouter, createWebHashHistory, createWebHistory, type RouteRecordRaw } from "vue-router";
export const Layout = () => import("@/layout/index.vue");
@ -676,7 +676,7 @@ export const constantRoutes: RouteRecordRaw[] = [
*
*/
const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
routes: constantRoutes,
// 刷新时,滚动条位置还原
scrollBehavior: () => ({ left: 0, top: 0 }),

View File

@ -0,0 +1,3 @@
<template>
<div>超级会员管理</div>
</template>