<el-table-column type="selection" min-width="100" align="center" /> <el-table-column prop="userName" label="姓名" width="180"> </el-table-column> <el-table-column prop="type" label="类型" width="180"> </el-table-column> <el-table-column prop="status" label="状态" width="18...
<el-table-column type="selection"width="55"v-if="!templateStatus"></el-table-column> <el-table-column prop="templateId"align="left"label="模板ID"sortable></el-table-column> <el-table-column prop="templateName"align="left"label="模板名称"></el-table-column> <!--<el-table-column p...
<el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column> --- </el-table> 1. 2. 3. 4. 5. 6. 7. 8. 9. 控制是否显示select下拉框 tableDbEdit(row, column, event) { this.showInput = column.property + row.inboundId; this.oldData[...
<el-table-column type="selection" :selectable="checkStatus"> </el-table-column> //--- js method --- checkStatus(row){ // 当勾选个数大于限定个数(limit )且当前不在勾选状态时 禁止勾选 const selectArr = ( getSelectArr 获取的勾选数组) const state = selectArr.some(item=>item.id == ...
1)在表格加上属性 :row-key="(row) => { return row.id }" row-key绑定一个函数,该函数返回每行数据的唯一标识 2)在多选的column标签加上 :reserve-selection=“true” 开启 大功告成!是不是很快? 优点:快捷简单方便 缺点:1. elementUI的版本不能太低 ...
<el-table v-loading="loading":data="discountList":row-key="(row) => row.id"ref='multipleTable'@selection-change="handleSelectionChange"> <el-table-column type="selection"width="55":reserve-selection="true"></el-table-column> <el-table-column property="title"label="名称"width="150">...
给type为selection的el-table-column添加上reserve-selection属性 给el-table添加上:row-key="row => row.productCategoryId",id必须是唯一的 如此,便可以在翻页时保留数据 如果elementui版本较低,没有自动勾选上,可以在获取到接口数据后添加上: if (this.multipleSelection.length > 0) { ...
handleSelectionChange"><el-table-column type="selection" width="70"></el-table-column><el-table-column prop="id" min-width="100%" label="" align="center"></el-table-column><el-table-column prop="name" min-width="100%" align="center"></el-table-column><el-table-column prop="...
type="danger" @click="handleDelete(scope.$index, scope.row)">删 除</el-button> </template> </el-table-column> </el-table> handleSelectionChange(val) { val:复选框选中的每个对象组成的数组 let ids =val.map(item=>item.id) this.multipleSelection= ids; 取出每个对象的id ...
:data="tableData" :row-key="row => row.id" @selection-change="handleSelectionChange" > <el-table-column type="selection"></el-table-column> <el-table-column prop="name" label="Name"></el-table-column> <el-table-column prop="age" label="Age"></el-table-column> ...