yaminncco / vue-sidebar-menu

A Vue.js Sidebar Menu Component

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to pin activeRecordIndex via. cookie or similar

GeorgeGardiner opened this issue · comments

It is fairly common in admin panel type applications to use a sidebar menu that links an index of items matching a filter. Clicking an item in the result index will then typically route to an "update / edit" screen.

The current mechanism for determining which menu item is active (based on route) is not a particularly good fit for this use case as clicking through will void the activeRecordIndex and collapse the menu.

Would it be possible for the menu to maintain state via. a cookie or similar? Currently when there is no good match the sidebar menu will just expand the final child which is an odd behaviour in and of itself.

Or bring back alias matching :)

Can you give more information about the case? because I'm not sure I understand the issue.

Consider the menu structure:

  • Products
    • Pre-Launch
    • Live
    • Archived

Basically want the menu to open correctly on both:

/products/live
/product/live/123

Nested routes should work

const routes = [
  {
    path: '/products',
    component: ...,
    children: [
      { path: 'live' },
      { path: 'live/:id' },
    ]
  }
]