Home > front end >  New inquire of vue is used in the router. AddRoutes access control to add dynamic routing is not eff
New inquire of vue is used in the router. AddRoutes access control to add dynamic routing is not eff

Time:09-20

 
//add dynamic routing table
The router. AddRoutes (store. State. AddRouters);
//the last add 404 page
The router. AddRoutes ([
{
Path: "*",
Redirect: "/404"
}
]);


Execution of the printed result code to add the routing table is the first to add dynamic routing array was successful but the second redirect page 404 no added so lead to go to the permissions page can hang directly rather than 404 page
Watch the instance of the everyone is like this why did I go wrong...

CodePudding user response:

First of all, you can output after dynamically register routing enclosing $router, check whether the routing registered in, then, view the corresponding components have registered 404 routing,

CodePudding user response:

reference 1/f, henan good response:
first of all, you can output after dynamically register routing enclosing $router, check whether the routing registration and went in, and then view the corresponding components have registered 404 routing,


I print out is in front of the routing results registered in the last 404 is not registered in...
  • Related