element-ui表格功能实现(删除选中)

时间:2021-04-23 10:36:07   收藏:0   阅读:241

表格删除选中的行实现,这里利用到了 __ob__  对象。vue每个双向绑定的数据都有__ob__

   del() {
      [...this.multipleSelection.map((n) => n.__ob__.dep.id)].forEach(
        (n) => {
          this.gridData.some((item, index) => {
            if (item.__ob__.dep.id == n) {
              this.gridData.splice(index, 1);
              return true;
            } else return false;
          });
        }
      );
    },

 

原文:https://www.cnblogs.com/lv77/p/14692170.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!