yaminncco / vue-sidebar-menu

A Vue.js Sidebar Menu Component
MIT License
646 stars 194 forks source link

Activate parent element when adding menu child element #265

Closed DeokJeong closed 9 months ago

DeokJeong commented 11 months ago

The sidebar menu is set to Main Menu > Middle Menu, and when you click the middle menu of the sidebar, a list-type screen appears. When you go to the detail page from the list, I want the sidebar main menu and middle menu to be activated. However, I couldn't find the criteria for activating the sidebar menu. Is there a way to activate this content?

p.s :) Thank you for making the menu. Really useful. If you use a translator, there may be mistranslations.

yaminncco commented 11 months ago

Configure vue-router routes so that the detail page is a child of the middle menu.

path: '/middle-menu',
children: [
    {
      path: '',
      name: 'MiddleMenu',
      component: MiddleMenu,
    },
    {
      path: '/detail',
      name: 'DetailPage',
      component: DetailPage,
  }
]

Now when you visit /detail /middle-menu should be active