一,vue3路由跳转
1,引入vue-router
import { useRouter } from 'vue-router';
2,steup中定义方法push,replace等等
const { push, replace} = useRouter();
二,vue3路由url传参
1,用push方法举例
push(`/order/freight/addFTemplate?id=${id}`);
2,引入vue-router(和跳转方法稍有不同,此处引入useRoute)
import { useRoute } from 'vue-router';
3,setup中定义route
const route = useRoute();
4,最后获取到所传参数
const id = route.query.id;