|
|
@@ -4,17 +4,13 @@
|
|
|
v-if="hasOneShowingChild(item.children, item)"
|
|
|
>
|
|
|
<a-menu-item :key="item.path" @click="changeRoute(item)" >
|
|
|
- <Icon :name="item.icon" />
|
|
|
- <span style="font-size: 16px;" >{{item.name}}</span>
|
|
|
+ <Title :title="item.name" :icon="item.icon" ></Title>
|
|
|
</a-menu-item>
|
|
|
</template>
|
|
|
|
|
|
<a-sub-menu v-else :key="item.path" >
|
|
|
<template #title>
|
|
|
- <Icon :name="item.icon" />
|
|
|
- <span style="font-size: 16px;" >
|
|
|
- {{item.name}}
|
|
|
- </span>
|
|
|
+ <Title :title="item.name" :icon="item.icon" ></Title>
|
|
|
</template>
|
|
|
<sidebar-item
|
|
|
v-for="child in item.children"
|
|
|
@@ -32,6 +28,7 @@ import { reactive, toRefs } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useAppRouter } from '@/store/router'
|
|
|
import Icon from './Icon'
|
|
|
+import Title from './title'
|
|
|
|
|
|
const appRouter = useAppRouter()
|
|
|
const RootRouter = useRouter()
|
|
|
@@ -49,8 +46,12 @@ const props = defineProps({
|
|
|
})
|
|
|
|
|
|
const changeRoute = (route: ROUTER.RoutesProps) => {
|
|
|
- RootRouter.push(route.path)
|
|
|
- appRouter.setCurrentRoute(route.path)
|
|
|
+ if (route.link) {
|
|
|
+ window.open(route.path)
|
|
|
+ } else {
|
|
|
+ RootRouter.push(route.path)
|
|
|
+ appRouter.setCurrentRoute(route.path)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const state = reactive({
|