table表格加row-key标识选中行唯一标识,多选框加reserve-selection设置为true
<template> <el-table v-loading="loading" ref="multipleTable" tooltip-effect="dark" :row-key="getRowKey"> <el-table-column label="" type="selection" width="50" align="center" :reserve-selection="true"></el-table-column> </table> </template>
<script>
methods: {
// 指定一个key标识这一行的数据
getRowKey (row) {
return row.id
}
}
</script>