问题可能出在参数传递上。在RefundDetails中,跳转到RefundList页面时,使用了params来传递参数。但是在RefundList页面中,没有获取到正确的参数值。

要解决这个问题,可以尝试以下步骤:

  1. 在RefundList文件中,添加一个created生命周期钩子函数。在该函数中,使用this.$route.params来获取传递过来的参数。
created() {
  const refundId = this.$route.params.RefundList;
  console.log('refundId:', refundId);
  // 调用查询方法并使用refundId进行查询
}
  1. 确保RefundList组件已经在路由中正确注册,并且在路由配置中设置了name属性为"RefundList"。
{
  path: '/refund-list',
  name: 'RefundList',
  component: RefundList
}
  1. 在RefundDetails文件中,确认refundInfo.refund.refundId的值不为null或undefined。可以在点击按钮时打印该值,确保它的值是正确的。
console.log('refundInfo.refund.refundId:', refundInfo.refund.refundId);

通过以上步骤,您应该能够成功将refundId传递给RefundList组件,并使用该值进行查询。如果问题仍然存在,请检查路由配置和参数传递的方式是否正确

文件RefundDetails:function toListbyidrefundId string consolelog按下了返回上一页的按钮; consolelogrefundId传回前面refundId; routerpush name RefundList params RefundList refundId ;el-button type=primary cli

原文地址: http://www.cveoy.top/t/topic/iLYJ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录