(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

相关推荐
东方小月9 小时前
从零开发一个 Coding Agent(四):使用状态机校验大模型事件流
前端·人工智能·后端
想做后端的前端9 小时前
WebGL实现FPS游戏
vue.js·游戏·webgl
Csvn9 小时前
🧩 ESM vs CJS 混用的 7 个「天坑」——从 TypeScript 编译到 Node 与浏览器
前端
Csvn9 小时前
🎯 Web 性能 API 集合:Performance Observer 的 5 个冷门妙用
前端
Csvn10 小时前
深入 React 闭包陷阱:从根源上理解并根治 stale closure
前端
whyfail10 小时前
前端学 Spring Boot(8):接口为什么越用越慢?
前端·spring boot·后端
用户0595401744610 小时前
LangChain 记忆测试踩坑实录:这两个坑让我排查了 4 小时
前端·css
程序员黑豆10 小时前
鸿蒙应用开发:@Monitor 装饰器使用教程
前端·harmonyos
用户9385156350711 小时前
从零构建《天龙八部》知识库:EPUB 加载→文本分割→向量嵌入→Milvus 存储→RAG 问答,一条链路打通
javascript·人工智能·全栈
SamChan9011 小时前
在Web应用中集成PDF多语言翻译功能:PDFTranslator API实战指南
前端·python·ai·pdf·yapi·机器翻译