1、Table Attributes
row-key
2、Table-column Attributes
reserve-selection
3、Table Methods
toggleRowSelection
<el-table
border
ref="table"
:header-cell-style="{background:'#DFEAFF',color:'#596998',fontSize:'13px',fontWeight:600}"
:data="tableList"
:select-on-indeterminate="false"
@select="selectEvent"
@selection-change="handleSelectionChange"
row-key="code"
height="500"
>
<el-table-column
:reserve-selection="true"
type="selection"
width="55">
</el-table-column>
<el-table-column
prop="code"
label="序号"
width="120">
</el-table-column>
<el-table-column
prop="content"
label="特约内容">
<template slot-scope="{row: {content}}">
<div class="appoint-text">{{content}}</div>
</template>
</el-table-column>
</el-table>
// 翻页 查询 默认 选中状态
toggleRowSelection() {
this.selectedList.forEach((item) => {
this.$refs.table.toggleRowSelection(item, true)
});
},
网友评论