diff --git a/packages/nc-gui/components/template/Editor.vue b/packages/nc-gui/components/template/Editor.vue index 66ecc7a5f8..ca5943a4fb 100644 --- a/packages/nc-gui/components/template/Editor.vue +++ b/packages/nc-gui/components/template/Editor.vue @@ -219,8 +219,9 @@ function deleteTable(tableIdx: number) { data.tables.splice(tableIdx, 1) } -function deleteTableColumn(tableIdx: number, columnIdx: number) { - data.tables[tableIdx].columns?.splice(columnIdx, 1) +function deleteTableColumn(tableIdx: number, columnKey: number) { + const columnIdx = data.tables[tableIdx].columns.findIndex((c: ColumnType & { key: number }) => c.key === columnKey) + data.tables[tableIdx].columns.splice(columnIdx, 1) } function addNewColumnRow(tableIdx: number, uidt: string) {