A文件代码:function toGoodsOrderorderId string consolelog到这里了吗 refundInforefundorderId routerpush name OrderList params OrderList orderId 跳转到OrderList路由时传递一个名为OrderList的参数参数值为orderId。 qu
B文件代码: 在B文件中,你可以通过$route对象获取A文件传递过来的orderId参数。然后使用orderId进行查询相关数据。
export default { created() { this.fetchData(); }, methods: { fetchData() { // 通过$route对象获取A文件传递过来的orderId参数 const orderId = this.$route.query.orderId;
// 使用orderId进行数据查询操作
// ...
}
} } 注意:在B文件中,你需要确保已经正确设置了路由参数和查询参数的名称,以及路由的配置。
原文地址: https://www.cveoy.top/t/topic/iXKW 著作权归作者所有。请勿转载和采集!