zoukankan      html  css  js  c++  java
  • 数组中数组去除一个值

    1、// 移除表扬单个照片

      //  for (var i in this.TzForm.praise.image) {
          //         for (var k in this.TzForm.praise.image[i]) {
          //            if (this.TzForm.praise.image[i][k] == file.uid) {
          //                delete this.TzForm.praise.image[i];
          //             break;
          //             }
          //         }
          //     }

    // this.TzForm.praise.forEach(item => { // item.image.forEach(items => { // items.url != file.url; // }); // });

    //过滤不符合的一个,等于删除了一个 // this.TzForm.praise = this.TzForm.praise.filter(item => item.url != file.url);

    // this.TzForm.praise = this.TzForm.praise.forEach(item => // item.image.filter(items => { // items.url != file.url; // }) // );

    //数组里数组循环遍历两次,去除一个 for (let i = 0; i < this.TzForm.praise.length; i++) { for (let j = 0; j < this.TzForm.praise[i].image.length; j++) { if (file.url == this.TzForm.praise[i].image[j].url) { this.TzForm.praise[i].image.splice(j, 1); } } }
    看到我的div了吗?在你那你就完蛋了
  • 相关阅读:
    bzoj3622: 已经没有什么好害怕的了
    BSGS
    LOJ#2320 生成树计数
    ??? cliquers
    生成函数
    洛谷P5206 数树
    01分数规划
    差分约束系统
    51nod1238 最小公倍数之和 V3
    51nod1237 最大公约数之和 V3
  • 原文地址:https://www.cnblogs.com/web-shu/p/13042982.html
Copyright © 2011-2022 走看看