1.this.$route.query的使用
A、传参数:
this.$router.push({
path: '/monitor',
query:{
id:id,
}
})
B、获取参数:
this.$route.query.id
D、页面之间用路由跳转传参时,刷新跳转后传参的页面,数据还会显示存在(项目中遇到此问题)
2.this.$route.params的使用
A、传参数:
this.$router.push({
name: 'monitor',
params:{
id:id,
}
})
B、获取参数:
this.$route.params.id
D、页面之间用路由跳转传参时,刷新跳转后传参的页面,数据不存在(项目中遇到此问题)