import {useRouter} from 'vue-router'
let router = useRouter();
router.push({
//传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定
path:'/home',
query:{
num:1
}
//name:'Home',
//params:{
//num:1
//}
);
接收参数
import {useRoute} from 'vue-router'
let route = useRoute();
let num = route.query.num;
//let num = route.params.num;