</el-menu> import {useRoute,onBeforeRouteUpdate} from 'vue-router'const route=useRoute(); onMounted(()=>{ activeMenu.value= route.matched[2].path//数组的下标需要根据自己的路由的等级来判断}) onBeforeRouteUpdate((routeInfo)=>{ activeMenu.value= routeInfo.matched[2].path })...