(1)一维数组:
let bool = this.list.every(item => {
if (!item.content && item.required == 1) {
uni.showToast({ title: `请输入${item.name}`, icon: 'none' });
return false;
} else {
return true;
};
});
(2)二维数组:
let bool = this.list.every(item => {
return item.every(ele => {
if (!ele.content && ele.required == 1) {
uni.showToast({ title: `请输入${item.name}`, icon: 'none' });
return false;
} else {
return true;
};
});
});