传参
import { useRouter } from "vue-router"; 
const router = useRouter();
router.push({ path: "/Detail", query: { id:"123" } }); 
接受
import { useRoute } from "vue-router";
const route = useRoute();
console.log(route.query.id);

注意:
需要引入路由,在setup()创建对象,再使用,区分引入路由不同
传参是router, 引入useRouter
接收参数是route, 引入useRoute

Logo

前往低代码交流专区

更多推荐