yaminncco / vue-sidebar-menu

A Vue.js Sidebar Menu Component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Activate parent element when adding menu child element

DeokJeong opened this issue · comments

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.

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