这是图片列表页面 a页面
1、在a页面,写上跳转路由(to(跳转)到detailrequire页面,附带上图片的id)
2、跳转需要写跳转路由,在router/index.vue中写路由
3、在detailrequire页面接收该id
接收id有两种方法,区别见
两者区别
1、this.$route.query.id
2、this.$route.params.id
或者
{
path: '/myShow',
name: 'MyShow',
component: () =>
import(/* webpackChunkName: 'Login' */ 'Src/views/MyShow.vue'),
meta: {
title: 'TA的主页',
},
},
@click="jump(contentData.createBy.userId)"
jump(userId) {
this.$router.push({ path: '/myShow/', query: { userId: userId }})
},
页面用this.$route.query.userId
获取