ElementUi Table核取方塊回顯

晴天的部落格發表於2020-10-10

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;
                                }
                            }
                        })

相關文章