After the page is redirected by this.$router.push("xxx") when using element-ui el-submenu, the navigation menu label does not change

insert image description here

The solution is as follows:

  1. Add router to el-menu
  2. index must be bound to the path of the route, refer to the above example, '/' must not be missing
  3. default-active is set to the current route (this.$route.path), so that when the route changes, the corresponding menu-item will be highlighted

Guess you like

Origin blog.csdn.net/baidu_38493460/article/details/131051167