[Vuejs]-Vuetify list : open group according to active route

0👍

Here is my solution using route watch : https://codesandbox.io/s/vuetify-router-template-0176-vy766 (based on Daniel’s code).

The insteresting part is in Nav.vue:`

watch: {
  $route(to, from) {
    if (to.matched.length > 1) {
      const parent = to.matched.filter(m => !m.parent)[0];
      const route = routes.filter(route => route.name === parent.name)[0];
      route.active = true;
    }
  }
}

Leave a comment