|
@@ -11,13 +11,14 @@
|
|
|
@breakpoint="onBreakpoint"
|
|
@breakpoint="onBreakpoint"
|
|
|
>
|
|
>
|
|
|
<a-menu
|
|
<a-menu
|
|
|
- v-model:selectedKeys="selectedKeys2"
|
|
|
|
|
|
|
+ :selectedKeys="selectedKeys2"
|
|
|
v-model:openKeys="openKeys"
|
|
v-model:openKeys="openKeys"
|
|
|
mode="inline"
|
|
mode="inline"
|
|
|
:style="{ height: '100%', borderRight: 0 }"
|
|
:style="{ height: '100%', borderRight: 0 }"
|
|
|
>
|
|
>
|
|
|
|
|
+
|
|
|
<template v-for="item in appRouter.router.sider.route" :key="item.path">
|
|
<template v-for="item in appRouter.router.sider.route" :key="item.path">
|
|
|
- <a-sub-menu v-if="item.children" :key="item.path">
|
|
|
|
|
|
|
+ <a-sub-menu v-if="item.children" :key="item.path" >
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<user-outlined />
|
|
<user-outlined />
|
|
|
<span>
|
|
<span>
|
|
@@ -28,7 +29,8 @@
|
|
|
<user-outlined />{{_.name}}
|
|
<user-outlined />{{_.name}}
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
|
</a-sub-menu>
|
|
</a-sub-menu>
|
|
|
- <a-menu-item v-else @click="changeRoute(item)" >
|
|
|
|
|
|
|
+ <!-- v-if="!item.children" :key="item.path" -->
|
|
|
|
|
+ <a-menu-item v-if="!item.children" :key="item.path" @click="changeRoute(item)" >
|
|
|
<user-outlined />
|
|
<user-outlined />
|
|
|
<span>{{item.name}}</span>
|
|
<span>{{item.name}}</span>
|
|
|
</a-menu-item>
|
|
</a-menu-item>
|
|
@@ -62,6 +64,8 @@ const selectedKeys2 = ref<string[]>([appRouter.router.sider!.selectPath])
|
|
|
const openKeys = ref<string[]>(appRouter.router.sider!.openKeys)
|
|
const openKeys = ref<string[]>(appRouter.router.sider!.openKeys)
|
|
|
|
|
|
|
|
emitter.on(Emitter.NAVBAR, () => {
|
|
emitter.on(Emitter.NAVBAR, () => {
|
|
|
|
|
+ console.log('[appRouter.router.sider!.selectPath]:', [appRouter.router.sider!.selectPath])
|
|
|
|
|
+
|
|
|
selectedKeys2.value = [appRouter.router.sider!.selectPath]
|
|
selectedKeys2.value = [appRouter.router.sider!.selectPath]
|
|
|
openKeys.value = appRouter.router.sider!.openKeys
|
|
openKeys.value = appRouter.router.sider!.openKeys
|
|
|
})
|
|
})
|
|
@@ -80,6 +84,9 @@ const changeRoute = (route: Router.RoutesProps) => {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
|
|
+/deep/ .ant-layout-sider-children {
|
|
|
|
|
+ margin-top: -4px;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|