Elementui Navigation menu Refresh folding problem, highlight problem

this question contains two questions:

1, folding problem after elementui navigation menu refresh;
2, when switching to elemrntui navigation menu, no matter which page you switch to, the page highlights first and then loses highlight, and the previous menu becomes highlighted again. If you want to change the highlighted route, you have to refresh.

desired effect:

1. Navigation does not fold automatically after refresh.
2. When you click to switch menus, the menu currently selected is highlighted.

what has been done:

default-active has been set in the < el-menu > tag, but it does not take effect

clipboard.png

Jun.17,2022

$route.path and the following: index= "" does not match


problem solution: to determine whether the current route is active, add the active route to the route after activation.

Menu