直接复制就能实现 在 VUE X 中实现
<template>
<div id="app">
<table>
<thead>
<th><input type="checkbox" v-model="flag" @change="all()"></th>
<th>id</th>
<th>姓名</th>
</thead>
<tbody>
<tr v-for="(item,key) in list" :key="key">
<td><input type="checkbox" v-model="arr" :value="item.id"></td>
<td>{
{item.id}}</td>
<td>{
{item.name}}</td>
</tr>
</tbody>
</table>
{
{arr}}
<button @click="del()">选中删除</button>
<button @click="change()">改变 深度监听</button>
</div>
</te
全选 反选 选中删除 以及深度监听改变数据
最新推荐文章于 2021-01-16 20:31:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)