1.
错误是由于数组对象未定义或为null 引起的,所以查看获取数据的接口是否请求到的数据是null。
在数据处理中,添加判断数据是否为 null 来处理该问题。
onsuccess(res) {
console.log(res.data.data, "贯标比对");
if (res.data.data != null) {
self.comparemodellist = res.data.data;
self.pagination.totalSize = res.data.total;
self.column_name = res.data.data[0].column_name;
self.comp_time = res.data.data[0].comp_time;
}
},