1. import {useRouter} from 'vue-router'
    2. let router = useRouter();
    3. router.push({
    4. //传递参数使用query的话,指定path或者name都行,但使用params的话,只能使用name指定
    5. path:'/home',
    6. query:{
    7. num:1
    8. }
    9. //name:'Home',
    10. //params:{
    11. //num:1
    12. //}
    13. );

    接收参数

    1. import {useRoute} from 'vue-router'
    2. let route = useRoute();
    3. let num = route.query.num;
    4. //let num = route.params.num;