有一个我问题如果将第一组的相同图片删掉,而第二组相同的图片不加入数组中,那相同的图片怎么显示呢
diffArr.forEach(([, i2]) => {
this.figures.every((figure, index) => {
//将第一组的图片地址存入src中
let src = methods.$('img', figure).src;
if (src === nextImgs[i2]) {
console.log(this.figures.splice(index, 1))
this.figures.splice(index, 1);
console.log(this.figures)
return false;
}
return true;
});
});
this._calcPosition(els);
let needAppendEls = [];
if (diffArr.length) {
let nextElsIndex = diffArr.map(([, i2]) => i2);
els.forEach((figure, index) => {
//将包含的共同照片剔除,添加不同的图片
if (!nextElsIndex.includes(index)) {
needAppendEls.push(figure)
}
})
} else {
needAppendEls = els;
}
//为什么没用加setTimeout
this.figures.forEach(el => {
console.log(45)
el.style.transform = 'scale(0, 0) translate(0%, 100%)';
el.style.opacity = '0';
});49
收起
正在回答 回答被采纳积分+1
2回答
相似问题
登录后可查看更多问答,登录/注册
4.Vue与React高级框架开发
- 参与学习 人
- 提交作业 239 份
- 解答问题 10739 个
本阶段带你深入前端开发的肌理,通过ES6基础知识和前端主流高级框架的学习,助你快速构建企业级移动webAPP应用,进入职场的终极battle
了解课程



恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星