fix
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
mode="inline"
|
||||
@click="handleClick"
|
||||
>
|
||||
|
||||
<div v-for="(menu) in rootSubmenuKeys" :key="menu.key" >
|
||||
<a-menu-item :key="menu.key" :name="menu.name" :route="menu.route" v-if="!menu.children">
|
||||
<template #icon>
|
||||
@@ -68,7 +67,7 @@
|
||||
<script lang="ts">
|
||||
import { LoadingOutlined } from "@ant-design/icons-vue";
|
||||
import { message, Upload } from "ant-design-vue";
|
||||
import { defineComponent, onMounted, h, ref, nextTick, computed,reactive, toRefs } from "vue";
|
||||
import { defineComponent, onMounted, h, ref, nextTick, computed,reactive, toRefs, onBeforeMount } from "vue";
|
||||
import { MailOutlined, AppstoreOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
||||
import { Https } from "@/tool/https";
|
||||
import { useStore } from "vuex";
|
||||
@@ -135,20 +134,19 @@ export default defineComponent({
|
||||
}else{
|
||||
router.push('/administrator')
|
||||
}
|
||||
|
||||
state.rootSubmenuKeys.forEach((item:any) => {
|
||||
if(item.children){
|
||||
item.children.forEach((item:any) => {
|
||||
if(item.route == router.currentRoute.value.path){
|
||||
state.selectedKeys[0] = item.key
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(item.route == router.currentRoute.value.path){
|
||||
state.selectedKeys[0] = item.key
|
||||
}
|
||||
}
|
||||
});
|
||||
// state.rootSubmenuKeys.forEach((item:any) => {
|
||||
// if(item.children){
|
||||
// item.children.forEach((item:any) => {
|
||||
// if(item.route == router.currentRoute.value.path){
|
||||
// state.selectedKeys[0] = item.key
|
||||
// }
|
||||
// });
|
||||
// }else{
|
||||
// if(item.route == router.currentRoute.value.path){
|
||||
// state.selectedKeys[0] = item.key
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//储存所有用户id和name
|
||||
Https.axiosGet(Https.httpUrls.getAllUserId,).then((rv: any) => {
|
||||
if (rv) {
|
||||
@@ -171,6 +169,9 @@ export default defineComponent({
|
||||
// router.push(state.rootSubmenuKeys[0].route)
|
||||
|
||||
})
|
||||
onBeforeMount(()=>{
|
||||
state.selectedKeys = ['sub1']
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
onOpenChange,
|
||||
|
||||
Reference in New Issue
Block a user