ElemeFE / ElemeFE/element

<el-table>进行表格循环的时候搭配 <el-input>组件进行编辑表格操作例如开启了 :autofocus="true"会导致第一次进入页面启用编辑状态后,导致表格错版

Open
#23,018 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

下面是触发bug的表格代码:





{{ scope.row[item.list[0].key] }}




{{ scope.row[Sitem.key]}}




如果 :autofocus="true"那么在第一次进入页面时,进入编辑状态后会导致输入框的所在表格移位到其他表格中,导致页面单元格错乱,但是再进行一次浏览器刷新后,再进入编辑状态后输入框就恢复正常了。
formData: {
handler (newVal) {
const { tableData, tableTitle, tableTitleTree } = newVal
if (tableData || tableTitle) {
this.tableTitle = tableTitle.map((item) => {
return {
...item,
key: item.key.toString(),
}
})
this.tableData = JSON.parse(JSON.stringify(tableData))
this.tableTitleTree = JSON.parse(JSON.stringify(tableTitleTree))
this.changedData = JSON.parse(JSON.stringify(tableData))
}
},
deep: true,
immediate: true,
},

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.