From 4f9c711012b6db12d06b463a00f317b80cf7ad55 Mon Sep 17 00:00:00 2001 From: YueCHEN195 <57787499+YueCHEN195@users.noreply.github.com> Date: Sat, 29 Jul 2023 10:42:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DBasicTable=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=BC=80=E5=90=AF=E5=8F=AF=E7=BC=96=E8=BE=91=E8=A1=8C?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF/=E5=8D=A1=E6=AD=BB=E9=97=AE=E9=A2=98=20(#293?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Table/src/components/editable/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Table/src/components/editable/index.ts b/src/components/Table/src/components/editable/index.ts index 4f7d4dac..548c9e4b 100644 --- a/src/components/Table/src/components/editable/index.ts +++ b/src/components/Table/src/components/editable/index.ts @@ -1,6 +1,6 @@ import type { BasicColumn } from '/@/components/Table/src/types/table'; -import { h, Ref } from 'vue'; +import { h, Ref, toRaw } from 'vue'; import EditableCell from './EditableCell.vue'; import { isArray } from '/@/utils/is'; @@ -13,7 +13,7 @@ interface Params { export function renderEditCell(column: BasicColumn) { return ({ text: value, record, index }: Params) => { - record.onValid = async () => { + toRaw(record).onValid = async () => { if (isArray(record?.validCbs)) { const validFns = (record?.validCbs || []).map((fn) => fn()); const res = await Promise.all(validFns); @@ -23,7 +23,7 @@ export function renderEditCell(column: BasicColumn) { } }; - record.onEdit = async (edit: boolean, submit = false) => { + toRaw(record).onEdit = async (edit: boolean, submit = false) => { if (!submit) { record.editable = edit; }