From 1e34183e7ab0d20e2f85f1e5771a7d7f09c02f08 Mon Sep 17 00:00:00 2001 From: xingyu Date: Fri, 4 Aug 2023 20:06:00 +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?= 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 ed47c9b4..e8ac140d 100644 --- a/src/components/Table/src/components/editable/index.ts +++ b/src/components/Table/src/components/editable/index.ts @@ -1,5 +1,5 @@ import type { Ref } from 'vue' -import { h } from 'vue' +import { h, toRaw } from 'vue' import EditableCell from './EditableCell.vue' import type { BasicColumn } from '@/components/Table/src/types/table' @@ -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) @@ -24,7 +24,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