it"s too inelegant and difficult to maintain all routes written in front-end code. If you want to store all the routing information in the database, use the back-end return data to dynamically generate the front-end route.
example code is as follows:
where routesData is the parameter instantiated by routing new Router
for (let i of data) {`````
every = {
path: i["path"],
name: i["name"],
component: () => import(i["src"]),
}
routesData.push(every)
}
but the above idea can not be realized, check the reason, import does not seem to support variables, broken eggs.
I do not know if my idea can be realized, is there a boss to solve the problem?