(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

相关推荐
Kratzdisteln1 天前
【无标题】
前端·python
李剑一1 天前
小红书前端架构面试问的挺深入啊!面试官:Vue中组合式API与选项式API的设计权衡
vue.js·面试
Curvatureflight1 天前
前端国际化 i18n 落地实践:语言包、动态文案和格式化问题怎么处理?
前端·c++·vue
kTR2hD1qb1 天前
Claude Code Skill的介绍与使用
java·前端·数据库·人工智能
一 乐1 天前
汽车租赁|基于SprinBoot+vue的汽车租赁管理系统(源码+数据库+文档)
数据库·vue.js·spring boot·汽车·论文·毕设·汽车租赁管理系统
修己xj1 天前
打造专属博文封面神器:一个开源免费的博文封面生成器ThisCover
前端
kyriewen1 天前
面试8家前端岗位后,我发现了一个残酷的事实:AI不是加分项,是门槛
前端·javascript·面试
Fighting_p1 天前
【面试 - el-select问题及解决】wujie 微前端下子系统 el-select 多选 filterable 过滤失效
前端
吃口巧乐兹1 天前
AI 全栈时代,为什么要服务端使用 NestJs
前端
yingyima1 天前
Redis 延迟任务队列:凌晨3点服务器报警的救星
前端