Closed rizahoemae closed 2 years ago
Can you provide a minimal reproduction or show me the routes config?
sure, here is routes config
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'home',
component: LayoutHome,
children: [
{
path: '',
name: 'dashboard',
component: Dashboard,
},
....
{
path: 'profile',
name: 'profile',
component: Profile,
},
],
},
],
})
as you can see above, the dashboard and profile are in the same state, under their parent (/)
Use exact
{
..
href: { name: 'dashboard' },
exact: true,
},
woah it works! thankyou for your help!!
hello, i have a question. The top link is directed to /, but when the /profile is active, for example, the link above is also active. how to solve this? thanks.
[edited] in case if question is not clear, i add some ways i use your sidebar in my project:
route.name = dashboard print route path / route.name = profile print route path /profile