[Vuejs]-Nuxt & Vue – Element UI Persisting active menu item on browser back button event

0👍

In your nuxt.config.js file add the following:

router: {
    linkExactActiveClass: 'active'
}

nuxt doesn’t use an active class by default for active links.

Also you will need to use the <nuxt-link> component for the active class to be bound to the active page link
https://nuxtjs.org/api/components-nuxt-link/

👤Nate

1👍

It turns out I was able to solve it with a little experimentation and it was remarkably simple.

  1. Set the default-active prop to $route.path
  2. Set the index of the item to it’s respective path

That is what worked for me, hopefully it helps someone in the future

Leave a comment