默认触发列表第一项的点击

This commit is contained in:
huangchenhao 2025-11-07 18:13:40 +08:00
parent cc28570a29
commit 9a917c89ce
2 changed files with 7 additions and 3 deletions

View File

@ -39,8 +39,12 @@ export default () => {
} }
}; };
onMounted(() => { onMounted(async () => {
getMenuList() await getMenuList();
const firstMenuItem = menuList.value[0]?.children?.[0];
if (firstMenuItem) {
handleMenuClick(firstMenuItem);
}
}) })
return { return {

View File

@ -5,7 +5,7 @@ const routes = [
{ {
path: '/', path: '/',
name: 'Home', name: 'Home',
redirect: '/cockpit', component: () => import('../views/Home.vue')
}, },
{ {
path: '/cockpit', path: '/cockpit',