问题:在做一个列表页面的时候,有一些input或select作为筛选条件来查询,加了一个重置功能,要清空这些数据 

使用了vue的这个方法来清除 Object.assign(this.$data.params,this.$options.data().params);

重置时发现在报错,报错原因是params里面有route的传值:this.$route.params.batchNumber

1       params: {
2         batchNo: this.$route.params.batchNumber? this.$route.params.batchNumber : null,
3         orderId: null,
4         isRepeat: null,
5         loanOrderStatus: null,
6         page: 1,
7         pageSize: 10,
8       },

后来查找原因,参考这篇文章解决;

https://blog.csdn.net/mocoe/article/details/89682022

改成这样子,Object.assign(this.$data.params, this.$options.data.call(this).params);问题解决

 

相关文章:

  • 2021-12-05
  • 2021-12-20
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-30
  • 2022-12-23
  • 2022-02-10
  • 2021-11-13
  • 2022-12-23
  • 2023-01-17
  • 2022-02-10
相关资源
相似解决方案