// An highlighted block
解决方法:
先使用JSON.stringify()转为字符串,字符串为单条数据,刷新页面数据就不会丢失,
再将字符串通过JSON.parse()转回来就可以。
handelDetails(row) {
this.$router.push({
path: "details",
query: {
row: JSON.stringify(row),//先转为字符串
sataus: "Editor",
},
});
},
//另一个页面
created() {
// 接受传递的参数
console.log(this.$route.query.sataus, '单条数据')
console.log(JSON.parse(this.$route.query.row), '对象数据');//转为对象
}
vue路由传递对象数组,刷新页面,数据丢失[object Object]
最新推荐文章于 2023-07-25 17:21:01 发布