Navigation is a first-level page, many first-level pages have secondary pages, enter the secondary page navigation will not be highlighted how to break? If it is not a nested route, how can you display the secondary page directly from another route?
Navigation is a first-level page, many first-level pages have secondary pages, enter the secondary page navigation will not be highlighted how to break? If it is not a nested route, how can you display the secondary page directly from another route?
1. If I understand it correctly, (if it is an icon, prepare two plots, one highlights and one does not highlight)
in the tag, use vMuif= "this.$route.path = 'routing path'" to judge;
if it is not a route, use window.location.href to read the current page URL, and then intercept the judgment.
2. Display the page directly and write {path: "/", redirect: component name} in the route. For example:
var router=new VueRouter ({
routes:[
{path:'/',component:index},
{path:'/main',component:main,
children:[
{path:'/',redirect:}, //URLxxx.com-sharp/main
{path:'',component:}
//...
]
}
]
})