Vue dynamically modifies routing (mirroring)

what if you mirror all existing routes?

for example:
existing address

www.xxx.com 
www.xxx.com/login 

if you dynamically add a layer to all routes, achieve the following effect (the reason route remains the same)

www.xxx.com/test 
www.xxx.com/test/login 

so far, I haven"t found any method, just guess if there is a way to mirror a route or modify the root route to achieve this effect.

I hope to get advice from all kinds of gods, thank you!


routes needs to be extracted separately
routes.js

export const routes = [
    {}
]

main.js

    import {routes} from routes.js
    new VueRouter({
        {
            path:'test',
            children:routes
        }
    })
< hr > In

history mode, it can cooperate with the back-end route, and set the back-end root route to test

.
Menu