问题:在做一个列表页面的时候,有一些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);问题解决