table表格中的数据有前端写死的假数据
点击编辑,将编辑内容回显到table表格当前行
点击保存,将添加内容存储在定义的对象中
//将填写内容赋值给定义的对象
_this.tableContent = {
proDesc: _this.form.desc,
attachName: _this.fileList[0].name,
status: "查看",
};
//通过子传父,将内容传递给父组件
_this.$emit("tableChild", _this.tableContent);
//父组件接收子组件值
<examineUploadFileDia
:diaVisKey.sync="examineUploadFileDiaVis"
:editParams="editParams"
:nameParams="nameParams"
:uploadUrl="$urls.tangshanElectricityInspection.addEleCheckTrade"
@tableChild="tableChild"
/>
tableChild(data) {
this.tableData.forEach((item) => {
if (this.activeName == item.processName) {
item.problem = data.proDesc;
item.status = data.status;
item.attachName = data.attachName;
}
});
},
//点击table当前行内容进行赋值
handleRowClick(row) {
this.activeName = row.processName;
},