Vue列表,点击一行时选中这一行对应的复选框

<el-table
:data="planList"
border
height="440px"
style="width: 100%"
@selection-change="handleSelectionChange"
@row-click="clickRow"
ref="table"
>
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="plancode" @click="clickRow(scope.row)" label="报告编号" sortable width="180"></el-table-column>
<el-table-column prop="planname" label="报告名称" sortable width="180"></el-table-column>
<el-table-column prop="rateyear" label="报送年度" sortable width="180"></el-table-column>
<el-table-column prop="rptenddate" label="报告结束日期" sortable width="180"></el-table-column>
<el-table-column prop="createdtime" label="创建时间" sortable width="180"></el-table-column>
<el-table-column prop="modifytime" label="修改时间" sortable width="180"></el-table-column>
<el-table-column prop="status" label="报告状态" :formatter="statusFormat" width="180"></el-table-column>
</el-table>

methods: {
clickRow(row){
this.$refs.table.toggleRowSelection(row);
}
}

 

posted @ 2022-08-22 16:41  干饭吧  阅读(411)  评论(0)    收藏  举报