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

表格删除选中的行实现,这里利用到了 __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;
          });
        }
      );
    },

 

上一篇:c#实现图片高质量压缩


下一篇:Vue 源码学习 —— 数据响应式原理 (Vue 2.x)