vue2重定向写法:
        //直接报错
        {
            path: "*",
            redirect: "/login"
        },

vue3重定向写法:
1:

           {
            path: "/:catchAll(.*)",
            redirect: "/login"
        }

2

          {
            path: "/:pathMatch(.*)",
            redirect: "/login"
        }

3

        {
            path: "/:pathMatch(.*)*",
            redirect: "/login"
        }

 

posted on 2022-04-25 13:33  刘世涛6192  阅读(900)  评论(1编辑  收藏  举报