vue连个数组对比

Posted 假装空白

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue连个数组对比相关的知识,希望对你有一定的参考价值。

      let Ids = this.houseList.map(item => item.houseId);
      let arr = new Array();
      this.projectOptions.forEach((item, index) => {
        if (!Ids.includes(item.id)) {
          arr.push(item);
        }
      });
      this.projectOptions = arr;

  使用 .map 和  .includes 配合使用

以上是关于vue连个数组对比的主要内容,如果未能解决你的问题,请参考以下文章