el-table翻页保持选中

2020-09-03  本文已影响0人  秀萝卜

参考资料:
https://www.jianshu.com/p/4888fc9a8108

<el-table v-loading="loading" :data="tableData" class="table" stripe @selection-change="handleSelectionChange" :row-key="getRowKeys">
                    <el-table-column type="selection" width="60" :reserve-selection="true"></el-table-column>
                    <el-table-column prop="memberId" label="客户ID"></el-table-column>
                    <el-table-column prop="memberName" label="客户名称"></el-table-column>
                    <el-table-column label="操作" width="180" align="center">
                        <template slot-scope="scope">
                            <el-button v-if="getPermission(91)" type="text" icon="el-icon-delete" class="red" @click="del(scope.row)"> 删除
                            </el-button>
                        </template>
                    </el-table-column>
                </el-table>

handleSelectionChange(val) {
            this.selectedData = val;
        },

getRowKeys(row){
            return row.memberId;
        },


上一篇下一篇

猜你喜欢

热点阅读