vue table刷新单行数据
2024-10-19 16:25:53
1.给el-table加上标记方法
<el-table v-loading="loading" :data="tagList1" @selection-change="handleSelectionChange1" :row-class-name="tableRowClassName">
tableRowClassName({ row, rowIndex }) {
row.index = rowIndex;
},
2.提交数据到后台,重新获取此行数据
confirmBut(row, type, tabIndex){
let _this = this
let putParam = {"confirmId": row.confirmId, "type":type}
editConfirmInfo(putParam).then(res =>{
if(res.code == 200){
//更改单行数据
//重新去数据库中获取
this.msgSuccess("成功");
_this.changeLine(row, tabIndex)
}else{
this.msgError("失败,刷新页面查看事件是否已被确认!")
}
})
},
changeLine(row, tabIndex){
selectSmtTagAllById(row.id).then(response => {
if(tabIndex==1){
this.tagList1.splice(row.index,1,response.data)
}else if(tabIndex==2){
this.tagList2.splice(row.index,1,response.data)
}else if(tabIndex==3){
this.tagList3.splice(row.index,1,response.data)
}
});
},
最新文章
- 依赖倒置(DIP)与依赖注入(DI)
- pom 详解
- jpa和hibernate注解
- Codeforces Round #344 (Div. 2)
- C++:对象数组
- HDU-3001 Travelling
- 关于ibatis进行物理游标分页
- windows 下,用CreateWaitableTimer SetWaitableTimer 创建定时器(用轮询的办法保持高精度)
- Shell遍历文件的每一行
- android sax解析xml 文件 动态加载标题
- linux下的文件权限
- C# 在本地创建文件夹及子文件夹
- Valgrind使用记录
- 浅谈我的MongoDB学习(二)
- python 关键字的操作
- hdu3340 线段树+多边形
- Istio入门实战与架构原理——使用Docker Compose搭建Service Mesh
- 使用java poi解析表格
- 分库分表之后全局id怎么生成
- C# 申请非托管内存
热门文章
- cmd无限弹窗
- [cocos2d-x]关于3.x的触摸机制
- 通过Terraform创建GCP Pubsub
- arm架构的M1对有i386和x86的架构不兼容
- Grafana 系列文章(二):使用 Grafana Agent 和 Grafana Tempo 进行 Tracing
- 结构型模式 - 组合模式Composite Pattern
- Casbin: 连续3年参加Google Summer of Code的开源授权技术领导者
- Kubernetes(k8s)控制器(三):ReplicationController
- 多个仓库源配置及repositories和mirrors的配置
- 【译】使用 ML.NET 进行机器学习 - 集群完整指南