The vue parameter passes the query string

vue project, I have an order (order) list page, the corresponding path is: test/order/all,
and an order details page, corresponding path: test/order/detail?id=123456
want to dynamically route matching according to the order id, because there are strings (question mark, equal sign, order number) in the path, how should I write my Path?


  
  { 
  path:"/order/detail?id=:id",
  component:OrderDetail,
},


 Path

vue-router dynamic routes are matched by / path/:id .

// 1
 { 
  path:'/order/detail/:id',
  component:OrderDetail
}
OrderDetailthis.$route.params.id

// 2
`path` '?q={id}' : /order/detail/id?q=123
this.$route.query.idid
For the operation of

advanced points, you can also use props:true to decouple.

ide/essentials/dynamic-matching.html" rel=" nofollow noreferrer "> official website documentation


1. Dynamic routing means

{

  path:'/order/detail:id',
  component:OrderDetail,

},

    
  `this.router.push({path:'/order/detail/132465'})`
URL /order/detail  (`this.$route.params.id`  )

2. Your requirement is to pass parameters to url

:
 `this.router.push({path:'/order/detail',query{id:132}})`
this.$route.query.id
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-1c2bf2e-33ab1.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-1c2bf2e-33ab1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?