Skip to content

Commit 4f9c711

Browse files
authored
fix: 修复BasicTable组件开启可编辑行卡顿/卡死问题 (#2939)
1 parent 12924fb commit 4f9c711

File tree

1 file changed

+3
-3
lines changed
  • src/components/Table/src/components/editable

1 file changed

+3
-3
lines changed

src/components/Table/src/components/editable/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { BasicColumn } from '/@/components/Table/src/types/table';
22

3-
import { h, Ref } from 'vue';
3+
import { h, Ref, toRaw } from 'vue';
44

55
import EditableCell from './EditableCell.vue';
66
import { isArray } from '/@/utils/is';
@@ -13,7 +13,7 @@ interface Params {
1313

1414
export function renderEditCell(column: BasicColumn) {
1515
return ({ text: value, record, index }: Params) => {
16-
record.onValid = async () => {
16+
toRaw(record).onValid = async () => {
1717
if (isArray(record?.validCbs)) {
1818
const validFns = (record?.validCbs || []).map((fn) => fn());
1919
const res = await Promise.all(validFns);
@@ -23,7 +23,7 @@ export function renderEditCell(column: BasicColumn) {
2323
}
2424
};
2525

26-
record.onEdit = async (edit: boolean, submit = false) => {
26+
toRaw(record).onEdit = async (edit: boolean, submit = false) => {
2727
if (!submit) {
2828
record.editable = edit;
2929
}

0 commit comments

Comments
 (0)