首页 VueJS Vue之ElementUI的Table删除修改按钮如何获取索引及相关json数据

Vue之ElementUI的Table删除修改按钮如何获取索引及相关json数据

作者:胡同里的砖头 围观群众:373 更新于:2021-12-09

<el-table-column align="center" label="操作" >
<template slot-scope="scope">
<el-button type="primary" size="small" @click="reset(scope)">重置</el-button>
</template>
</el-table-column>

reset({$index,row}) {
console.log("index:%d",$index);
this.$confirm("确定重置所有使用数据吗?", row.cmt, {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
await Reset(row.id).then((res)=>{
if(res.success)
this.cmtlist.splice($index, 1,res.data);
this.$message({
type: res.icon,
message: res.msg,
});
})
.catch((err) => {
console.error(err);
});
});
},

  • 本文标题: Vue之ElementUI的Table删除修改按钮如何获取索引及相关json数据
  • 文章分类:【VueJS】
  • 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.
留言评论
站点声明:
1、本站【胡同里的砖头】个人博客,借鉴网上一些博客模板,取其各优点模块自行拼装开发,本博客开发纯属个人爱好。
2、所有笔记提供给广大用户交流使用,可转载,可复制,纯个人开发所遇问题锦集记录使用
Copyright © huzlblog.com All Rights Reserved. 备案号:苏ICP备2021056683号-8