if(this.checkTimes.includes(_item.time)){ this.checkTimes = this.checkTimes.filter((item)=>{ return item != _item.time; }); }else{ this.checkTimes.push(_item.time); this.checkTimes = [...new Set(this.checkTimes)]; // 数组去重 /*if(this.checkTimes.length>8){ uni.showToast({ title:"最多选8个", icon:"none" }); this.checkTimes.splice(8,this.checkTimes.length-8); }/* }
标签:uniapp,item,length,添加,数组,time,checkTimes From: https://www.cnblogs.com/LindaBlog/p/17426990.html