1.多选
1-1:首先我们要再data声明一个空数组
1-2:vue不使用多选框 进行多选 全选

使用includes() 方法用于判断字符串是否包含指定的子字符串。
1-3:vue不使用多选框 进行多选 全选
去判断该数组里面是否含有这条数据的id 有就删除 没有就添加

2.全选
vue不使用多选框 进行多选 全选
声明一个变量 根据他的状态去做全选的判断
3.监听该数组的变化
watch:{
arrData(a) {
this.arrData.length === this.tableData.length && this.tableData.length;
if (this.arrData.length === this.tableData.length) {
this.generations = true;
} else {
this.generations = false;
}
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-12-06
  • 2022-02-16
猜你喜欢
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案