|
@@ -34,15 +34,11 @@
|
|
|
import { computed, onMounted, ref } from 'vue'
|
|
import { computed, onMounted, ref } from 'vue'
|
|
|
import { useAppRouter } from '@/store/router'
|
|
import { useAppRouter } from '@/store/router'
|
|
|
import user from './user.vue'
|
|
import user from './user.vue'
|
|
|
-import { useRouter, useRoute } from 'vue-router'
|
|
|
|
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
import { routes } from '@/router/index'
|
|
import { routes } from '@/router/index'
|
|
|
import { IconTsx } from '@/components/MicroComponents/index'
|
|
import { IconTsx } from '@/components/MicroComponents/index'
|
|
|
import { useDesignStore } from '@/store'
|
|
import { useDesignStore } from '@/store'
|
|
|
|
|
|
|
|
-const logoPng = require('@/assets/logo.png')
|
|
|
|
|
-
|
|
|
|
|
-const router = useRouter()
|
|
|
|
|
-
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
const appRouter = useAppRouter()
|
|
const appRouter = useAppRouter()
|
|
@@ -51,8 +47,6 @@ const selectedKeys = ref<string[]>()
|
|
|
|
|
|
|
|
const designStore = useDesignStore()
|
|
const designStore = useDesignStore()
|
|
|
|
|
|
|
|
-console.log('designStore:', !!designStore.theme, designStore.theme)
|
|
|
|
|
-
|
|
|
|
|
const iconName = computed(() => designStore.theme ? 'sun' : 'moon')
|
|
const iconName = computed(() => designStore.theme ? 'sun' : 'moon')
|
|
|
|
|
|
|
|
const headerBgColor = computed(() => designStore.theme ? '#141414' : '#fff')
|
|
const headerBgColor = computed(() => designStore.theme ? '#141414' : '#fff')
|
|
@@ -90,24 +84,18 @@ const hasCurrentRourte = (children: ROUTER.RoutesProps[]): boolean => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- routes.forEach(item => {
|
|
|
|
|
- if (item.children && hasCurrentRourte(item.children)) {
|
|
|
|
|
- selectedKeys.value = [item.path]
|
|
|
|
|
- appRouter.changeNavbar(item.path, 'init')
|
|
|
|
|
- appRouter.changeSiderRoute()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ // routes.forEach(item => {
|
|
|
|
|
+ // if (item.children && hasCurrentRourte(item.children)) {
|
|
|
|
|
+ // selectedKeys.value = [item.path]
|
|
|
|
|
+ // appRouter.changeNavbar(item.path, 'init')
|
|
|
|
|
+ // appRouter.changeSiderRoute()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped >
|
|
<style lang="less" scoped >
|
|
|
-.header {
|
|
|
|
|
- // width: 100%;
|
|
|
|
|
- // position: absolute;
|
|
|
|
|
- // z-index: 2;
|
|
|
|
|
- // background-color: #fff;
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
.df-center {
|
|
.df-center {
|
|
|
display: flex;
|
|
display: flex;
|