<el-table
:data="goodsData"
border
size="mini"
height="350"
ref="table"
:row-key="getRowKeys"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
:reserve-selection="true"
width="55"
align="center">
</el-table-column>
</el-table>
methods:
getRowKeys(row) {
return row.piId;
}
说明:下面这三项是决定状态保持的关键。
type="selection"
:reserve-selection="true"
:row-key="getRowKeys"