【vue】el-table 数据更新后,刷新表格数据

表格里面的数据更新后,可以通过以下方法来刷新表格

方法1 用更新后的数据,覆盖之前的数据

复制代码
var newTableData=[];

for(var i=0;i<that.tableData.length;i++){   

    if(aId==that.selectStationId&&bId==that.selectDeviceId){

        that.tableData[i].physicalid=physicalId;

    }

    newTableData.push(that.tableData[i]);

}

that.tableData=newTableData;

方法2 使用$nextTick

复制代码
<el-table :Key="key"></el-table>

//Data里面定义

key:0

//使用

this.$nextTick(()=>{

  this.key++;

})
相关推荐
2601_958492551 天前
Optimizing Engagement with Freehead Skate - HTML5 Game - Construct 3
前端·html·html5
茉莉玫瑰花茶1 天前
工作流的常见模式 [ 1 ]
java·服务器·前端
zhangxingchao1 天前
AI应用开发六:企业知识库
前端·人工智能·后端
山峰哥1 天前
SQL慢查询调优实战:从全表扫描到索引覆盖的完整复盘
前端·数据库·sql·性能优化
红尘散仙1 天前
一个 `#[uniffi::export]`,把 Rust 接进 React Native
前端·后端·rust
moshuying1 天前
AI Coding 最大的 token 黑洞,可能根本不是 prompt
前端
红尘散仙1 天前
一行 `#[specta::specta]`,让 Tauri IPC 有类型
前端·后端·rust
lichenyang4531 天前
HarmonyOS HMRouter 接入记录:从普通 Tab Demo 到路由跳转
前端
木斯佳1 天前
前端八股文面经大全:腾讯WXG暑期前端一面(2026-05-15)·面经深度解析
前端·面试·笔试