project.peopleList({
'projectId': that.id }, function(data) { console.log('data',data); // 项目的所有参与人去掉项目负责人显示 that.peopleLists = [];//先清空,避免重复push for(var i = data.length - 1; i>=0; i--){ if(data[i].peopleId == that.currentPeople){ data.splice(i,1) }else{ that.peopleLists.push(data[i]); that.$emit('update:peopleLists',that.peopleLists) } } })
接口返回了3条数据,但是打印出的结果却是这样的
去掉for循环显示正常,想知道这是什么原因导致的这样的现象,谢谢大家
凤凰求蛊
相关分类