关于datatables的全选和反选实现
html部分:
<table data-toggle="table" class="table table-bordered text-center table-hover" id="customTable">
<thead>
<tr class="tr1">
<th class='th'>
<input type="checkbox" class="checkall" />
</th>
<th>员工工号</th>
<th>姓名</th>
<th>登录账号</th>
<th>手机号</th>
<th>部门</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
js部分:
var app = new Vue({
el:'#app',
data:{
loginId:localStorage.loginId,
token:localStorage.token,
idList:[], //选中的value值即id插入到一个数组中
// allIdList:[], //点击全选获取到的id
checkedData:'',//选中的每个复选框value值
},
/**
* 页面加载完成要做的事
* */
mounted: function () {
this.showCustomList();
},
methods: {
/**
* 页面初始化做的事儿
* */
showCustomList:function() {
var that = this;
$('#customTable').DataTable({
bLengthChange: fa