Vue background dynamically generates routes

clipboard.png


this.$router.addRoutes

json component: "Login" component: Login

import Login

clipboard.png
addRoutes

clipboard.png

Don"t you add on the login page

Mar.28,2021

the front end just returns a route name in the background of the incoming component on the page. The name should be the same as the incoming component name


pass an array

this.$router.addRoutes([
    {...}
]);
Menu