//跳转代码
router.push({
name: 'newPage',
params: {id : 1}
})
//接收代码
const res = router.currentRoute.value.params
console.log(res)
#获得的值为{}
const params = {id:1}
router.push({
name: "hrServiceInfo",
//一定要使用 params
state: { params }
})
const cellId = history.state.params.id
console.log(cellId)
参考链接:https://blog.csdn.net/qq_38666931/article/details/111308803