Vue route highlighted in two ways

Vue route highlighted in two ways

1. The first use mui
Here Insert Picture Description
if mui-active tab will be highlighted at this time the class each tab, if you do not write mui-active in this kind of thing, there is a default router-link-active class, we also need to own in this class to write highlight style, highlighted already have an existing class mui-active, so the solution is: to achieve in the routeHere Insert Picture Description

The second way: determining path, if at this time in the home, the home path / msite, and determines the current path is not the same, if the same, then the highlight class guide-item effect.
: Class = "{on: ' / msite === $ route.path'}"
Here Insert Picture Description

Published 58 original articles · won praise 20 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_40709110/article/details/102876152