(vue)el-table表格回显返回的已勾选的数据

(vue)el-table表格编辑时回显返回的已勾选的数据


tableData数据:


c 复制代码
el-table
  ref="multipleTable"
  :data="tableData"
  ...
>
	...
  <el-table-column prop="result" label="相关.." align="center" width="220">
    <template slot-scope="scope">
      {{ scope.row.result === 'NaN' ? '-' : scope.row.result }}
    </template>
  </el-table-column>
</el-table>
c 复制代码
aa(){
	...
	//返回数据
	const selectedRows = [{parametersName: "...重量", result: "NaN"}]
	
	this.tableData.forEach(item => {
	  selectedRows.forEach(e => {
	    if (e.parametersName === item.parametersName) {
	      this.$nextTick(() => {
	        this.$refs.multipleTable.toggleRowSelection(item)
	      })
	    }
	  })
	})
}

解决参考:https://blog.csdn.net/m0_73393602/article/details/134883201

相关推荐
500844 分钟前
React Native for OpenHarmony 实战:三方库 react-native-url-polyfill 的鸿蒙化适配指南
javascript·react native·react.js·性能优化·electron·harmonyos
补码缩写15 分钟前
视频跳转触发了seeked,画面就到位了吗
前端
库拉镜像AI牛牛19 分钟前
漫剧工作室量产方案:依托知漫剧 AI 短剧降本增效
大数据·服务器·前端·人工智能·语音识别
大纽耶耶26 分钟前
我把 YOLO 训练做成了网页版:需求设计与技术选型
vue.js
不可能片场28 分钟前
内容运营自动化 用相似度拦住撞车选题
前端·electron
静默回滚29 分钟前
视频进度条跳回去,先别改事件监听
前端
米多科技32 分钟前
让 AI 走进我的 3D 世界:一个 MCP server 的完整实现
javascript
大纽耶耶33 分钟前
开发 YOLO 训练管理平台的 23 个实践教训
vue.js
Lank_M34 分钟前
MP4和WebM导出后为何起播与拖动不同
前端
用户55084929025636 分钟前
前端本地存储怎么选:Cookie、localStorage、sessionStorage、IndexedDB 的取舍
前端