VUE-CLI通过 < router-link > 中的 to 怎么传递参数

时间:2018-11-13 15:06:46 类型:vue
字号:    

VUE-CLI通过 < router-link > 中的 to 传递参数

使用  router-link  to 是可以带上参数跳转的,我们只需要给 to 进行绑定,即 : to (v-bind:to)

1. router-link设置

   

2. router.js设置

   

3. newsdetail.vue接收

   


vue-cli传递参数相关:

1. vue-cli通过查询字符串传递参数

2. vue-cli使用url的rest风格传递参数

3. VUE-CLI通过 < router-link > 中的 to 怎么传递参数

4. vue-cli通过路由name传递参数