From 6f0498a9e7ee633310b4a08374409b3f1b7607b9 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 30 Oct 2025 20:08:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(form):=20text=E7=BB=84=E4=BB=B6=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=9A=84append.hander=E5=87=BD=E6=95=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0setModel/setFormValue=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form-schema/src/base.ts | 12 ++++++++---- packages/form/src/fields/Link.vue | 5 +++-- packages/form/src/fields/Text.vue | 26 ++++++++++++++++++++++---- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/packages/form-schema/src/base.ts b/packages/form-schema/src/base.ts index 2a309f93..6a309411 100644 --- a/packages/form-schema/src/base.ts +++ b/packages/form-schema/src/base.ts @@ -15,14 +15,14 @@ export interface ChangeRecord { export interface OnChangeHandlerData { model: FormValue; - values?: Readonly; + values?: Readonly | null; parent?: FormValue; formValue?: FormValue; config: Readonly; prop: string; changeRecords: ChangeRecord[]; setModel: (prop: string, value: any) => void; - setFromValue: (prop: string, value: any) => void; + setFormValue: (prop: string, value: any) => void; } export type FormValue = Record; @@ -361,7 +361,10 @@ export interface TextConfig extends FormItem, Input { mForm: FormState | undefined, data: { model: any; - values: any; + values?: Readonly | null; + formValue?: FormValue; + setModel: (prop: string, value: any) => void; + setFormValue: (prop: string, value: any) => void; }, ) => void; }; @@ -553,7 +556,8 @@ export interface LinkConfig extends FormItem { mForm: FormState | undefined, data: { model: Record; - values: Record; + values?: Readonly | null; + formValue?: FormValue; }, ) => FormConfig); fullscreen?: boolean; diff --git a/packages/form/src/fields/Link.vue b/packages/form/src/fields/Link.vue index bfa8c913..fcc701f0 100644 --- a/packages/form/src/fields/Link.vue +++ b/packages/form/src/fields/Link.vue @@ -17,7 +17,7 @@