数组包对象里面的数组的数据处理

593 阅读1分钟

cateList: {          title: "第一步",          name: "A1",          btnList: [            //每一个上传按钮            {              attachName: "附件一:",              filesList: [                {                  name: "1.jpeg",                  url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg",                },              ],            },            //第二个按钮            {              attachName: "附件二:",              filesList: [                {                  name: "2.jpeg",                  url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg",                },                {                  name: "1.jpeg",                  url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg",                },              ],            },          ],        },        {          title: "第二步",          name: "A2",          btnList: [            //每一个上传按钮            {              attachName: "附件一:",              filesList: [                {                  name: "1.jpeg",                  url: "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg",                },              ],            },          ],        },      ],

  handleRemove(file, fileList) {      let item = this.cateList[this.active].procedureEnclosureVoList;      //遍历数组中的对象      for (let key in item) {        //遍历对象中的数组        item[key].url.forEach((a) => {          let index = item[key].url.findIndex((b) => b.uid === file.uid);          if (index !== -1) {            item[key].url.splice(index, 1);          }        });      }      // console.log(this.cateList[0].btnList, 99);    },