原先用的是@selection-change="selectionLineChangeHandle",发现会出现数据错乱,选中下一条获取的数据还是上一条。解决方法如下:
template代码
//把下面语句 el-table @selection-change="selectionLineChangeHandle" ref="table" //改成 el-table @select="(selection, row) => {selectionLineChangeHandle(selection, row);}" ref="table"
js代码
//选中事件
selectionLineChangeHandle(selection, val) {
// 单选
this.dataonLineListSelections = [];
if (selection.length > 1) {
this.$refs.table.clearSelection();
this.$refs.table.toggleRowSelection(selection.pop());
}
if (selection.length > 0) {
this.dataonLineListSelections.push(val);
}
}
在列表接口中清空dataonLineListSelections
el-table利用:row-style="rowClass"设置指定行变色
el-table表格显示selection多选时对某些复选框设置禁止选中
el-table表格实现多选功能(全选/指定选中/取消选中)
上面是“el-table 单项type="selection"出现数据错乱解决”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_1979.html
workflows工作流
在白雪覆盖的广阔平原上两只可爱的小猫
图生图局部重绘ComfyUI工作流
一架受损严重的宇宙飞船内有一只猫
瀑布边坐着一位披着斗篷的隐士
梦幻中的一只猫咪ComfyUI工作流
一个港口配备了小型船只、起重机、集装箱和码头
一朵染血的白玫瑰ComfyUI工作流
晚上樱花狐狸ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

如何利用css3+js做一个下雨效果
纯CSS饼图效果
用svg画出游泳池动画效果
利用canvas画几个好玩的星云物种
用canvas实现画板涂鸦效果
canvas空间文本射线
css3动画loading效果










