{
path: "/mysearch/:keyword?",
name: 'mysearch',
component: MySearch,
meta: {'isShow': true, 'title': '搜索'},
},
{
path: '/detail/:skuid', //详情页
name: 'detail',
component: Detail,
meta: { isShow: true,},
}
定义路由
<!-- 在路由path:占位 这里把商品的id传过去 -->
<router-link :to="`/detail/${item.id}`" target="_blank">
<img :src="item.defaultImg" />
</router-link>
父路由组件定义router-link to到子组件并传递参数