当前位置:网站首页>After route link navigation, the sub page does not display the navigation style problem

After route link navigation, the sub page does not display the navigation style problem

2022-04-23 20:16:00 _ Carpediem

One 、 problem

When using , Click to enter navigation 1 The following sub pages , Navigation... Is not displayed 1 The current active style ( That is, the blue underline in the green box in the figure )
 Insert picture description here

Two 、 Source solution

modify router.ts Routing configuration information in the file
Mainly in navigation 1 Join in redirect

const router = createRouter({
    
  history: routerHistory,
  routes: [
    {
    
      path: "/ Navigation 1",
      component: '',
      redirect: " Navigation 1",
      children: [
        {
    
          path: " Navigation 1/ The following sub pages ",
          component:'',
        },
      ],
    },
  ],
});

版权声明
本文为[_ Carpediem]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210553546440.html

随机推荐