diff --git a/src/layout/index.vue b/src/layout/index.vue index 24b5360870c4c996df2a355e2c3ba4dde68481f0..e82feab98eb745d5ca1c73fc7a7a1f66d0e2cead 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -47,6 +47,10 @@ onMounted(() => { state.menuList = routes.reduce((pre, item) => { const isHiddenInLayout = item.meta.isHiddenInLayout if (!isHiddenInLayout) { + if(!pre.length){ + state.openKeys =[item.name] + state.selectedKeys = [item.name] + } const menuItem = { title: item.meta.title, path: item.path,