elementUI 怎么保持选择状态
1.设置row-key
<el-table :border="true" :highlight-current-row="true"
v-loading="loading"
element-loading-text="数据加载中..."
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
ref="multipleTable"
:data="partList"
:row-key="getRowKey"
tooltip-effect="dark"
style="width: 100%"
@select-all="handleSelectionAll"
@selection-change="handleSelectionChange">
getRowKey (row) {
return row.code
},
2.设置选择行状态
:reserve-selection=“true”
<el-table-column align="center" :reserve-selection="true" type="selection" width="55"></el-table-column>