1.使用path传值
![在这里插入图片描述](https://img-blog.csdnimg.cn/8601b19a76e24f4e8ac9b79a7aa3a755.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5Y-I6I-c5Y-I54ix546p5ZGc5ZGc5ZGcfg==,size_12,color_FFFFFF,t_70,g_se,x_16)
对应的就是这个path
this.$router.push({
path: '/text',
query:{
id: val.id
}
})
取值也对应的使用query
在子页面中取值
this.$route.query.id
2.用name传值
对应的是路由里面的name
this.$router.push({
name: 'text',
params:{
id: val.id
}
})
使用name传值使用的是params
子页面取值
this.$router.params.id