1.獲取表格checkbox的行的數據,綁定事件selection-change,回調返回值爲:devicesGridData,和下面代碼對應
<el-table :data="devicesGridData" ref="multipleTable" @selection-change="handleSelectionChange" :row-key="getRowKey"> <el-table-column type="selection" width="55" :reserve-selection="true"> </el-table-column> <el-table-column property="code" label="設備編號" width="100"></el-table-column> <el-table-column property="name" label="設備名稱" width="100"></el-table-column> <el-table-column property="modelType" label="設備規格"></el-table-column> </el-table>
handleSelectionChange(val) {
//alert(JSON.stringify(val));
this.multipleSelection = val;
},