first , Read the document carefully !!! Step on the pit bit by bit ~~~

Here's how params and query Two methods

1. use params Biography of ginseng

List page :

<router-link :to="{ name:'msgDetail', params: {id: item.msg_id}
}">( be careful : use params Parameters here is named route , use name)

</router-link>

The routing configuration is as follows :

export default new Router({

routes: [

 {

   path: '/msgDetail/:id',

   name: 'msgDetail',

   component: msgDetail

 }

]

Details page receiving parameters :

this.$route.params.id( be careful : Here is $route, instead of $router)

2. use query Biography of ginseng

List components :

<router-link :to="{ path: '/msgDetail', query: {id: item.msg_id}
}">( be careful : use query Here is the parameter with query , use path)

</router-link>

The routing configuration is as follows :

export default new Router({

routes: [

 {

   path: '/msgDetail',

   name: 'msgDetail',

   component: msgDetail

 }

]

Details page receiving parameters :

this.$route.query.id( be careful : Here is $route, instead of $router)

Technology
©2019-2020 Toolsou All rights reserved,
java Four functional interfaces ( a key , simple )os Simple use of module Browser kernel ( understand ) Some East 14 Pay change 16 salary , Sincerity or routine ?HashMap Explain in detail It's unexpected Python Cherry tree (turtle The gorgeous style of Library )html Writing about cherry trees , Writing about cherry trees