route.params在页面刷新的时候数据会丢失,所以vue3 弃用了params方式!
但是,vue3又更新了一个替代params的方式:history API
import { useRouter } from "vue-router"
const router = userRouter;
// 跳转路由,传递参数
const setClick = (item) => {router.push({name: "Devwithdrawal",state: { obj1: 1 , obj2: 2 },});
};//接收
onMounted(()=>{
// 获取history中我们上个页面保存的数据
const historyParam = history.state;
console.log(history.state,"history.state")})