watch(() => route.path,(newPath, oldPath) => {
if (newPath.includes(“/user”)) {
default_open.value = ‘0-1’
} else if(newPath.includes(“/role”)) {
default_open.value = ‘0-2’
}else if(newPath.includes(“/privilege”)) {
default_open.value = ‘0-3’
}
// console.log(“newPath:”+newPath)
},{ immediate: true })
import { watch, ref,reactive, } from ‘vue’
import { useRoute, useRouter,onBeforeRouteUpdate } from “vue-router”
import {Avatar,Tickets,Menu,List,} from ‘@element-plus/icons-vue’
const router = useRouter()
const route = useRoute()
const default_open = ref(‘0-0’)
const openeds = [‘0’]