ElementUi Table复选框回显

ElementUi Table复选框回显

UI代码:

  <el-table :data="acctSettleHangAccountList"  style="width:700px;"  height="300"
                            ref="multipleTable" tooltip-effect="dark" @selection-change="auditTableHandleSelectionChange" :reserve-selection="true" row-key="hangAccountId">

JS代码:

 that.$nextTick(() => {
                        if (that.$refs.multipleTable) {
                            that.$refs.multipleTable.clearSelection();
                        }
                        that.acctSettleHangAccountList.forEach(row => {
                            for (let j in arr) {
                                if (row.hangAccountId == arr[j].hangAccountId) {
                                    that.$refs.multipleTable.toggleRowSelection(
                                        row,
                                        true
                                    );
                                    break;
                                }
                            }
                        })

猜你喜欢

转载自blog.csdn.net/qq_43504447/article/details/109002120
今日推荐