Could you tell me how to use vue dynamic routing?

I looked at the official document and I didn"t understand it. How should I write it in this.$router.push ("/ xx1/xx2")?


Feb.28,2021

this.$post () is related to your server routing, while your this.$router is the front-end route, and 404not found is your submission data route that does not match. Don't you separate the front and back ends?


although I still don't understand what you want to do. Two ways:

  1. one is component reuse, login is the superior route, there is only one empty router-view, with two child routes, and both tea and stu are equipped with login components as child routes.

    path: '/login',
    component: xxxx,
    children: [
        {
            path: 'teaxxxx',
            component: Login
        },
        {
            path: 'teaxxxx',
            component: Login
        }
    ]
  2. is using the params parameter (the document is written)

    {
        path: '/login/:type', 
        name: 'login'
        component: Login
    }

    use this.$route.params.type within login components to get type

at the same time, it is suggested that route redirection is not recommended. Path, recommends using name jump.

.push({name: 'login', params: {type: 'teaxxxx'}})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b30b9e-34103.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b30b9e-34103.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?