vue-router query和params 传参和接收参数
1、params 方式传递和接收参数
//传参
this.$router.push({
name: 'checkDetailInfo',
params:{
fkdNum:fkdNum,
jyayStr:jyayStr,
defaultStr:defaultStr,
detailViewBtn:detailViewBtn
}
});
//接收参数
this.toplistInfo = this.$route.params;
2、query传参
//传参
this.$router.push({
path: '/checkDetailInfo',
query:{
fkdNum:fkdNum,
jyayStr:jyayStr,
defaultStr:defaultStr,
detailViewBtn:detailViewBtn
}
});
//接收参数
this.$route.query