From 3a7b91cf950c66c86544982339b8e7d4a8d5758b Mon Sep 17 00:00:00 2001 From: CHENYue <740451313@qq.com> Date: Fri, 28 Jul 2023 20:10:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=8F=AF=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=A1=A8=E6=A0=BCeditable=E7=BB=84=E4=BB=B6=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E6=B8=B2=E6=9F=93=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 4f7d4da..548c9e4 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; }