From cea65690204dbe8ccf178f92fa7c47ad6fd24a8c Mon Sep 17 00:00:00 2001 From: roymondchen Date: Thu, 23 Oct 2025 19:49:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(form):=20text=E6=96=B0=E5=A2=9Eprepend,=20?= =?UTF-8?q?append=E4=B8=8D=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form/src/fields/Text.vue | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/form/src/fields/Text.vue b/packages/form/src/fields/Text.vue index 82434a64..f3e1cec3 100644 --- a/packages/form/src/fields/Text.vue +++ b/packages/form/src/fields/Text.vue @@ -11,6 +11,9 @@ @input="inputHandler" @keyup="keyUpHandler($event)" > + @@ -66,18 +70,26 @@ const mForm = inject('mForm'); const appendConfig = computed(() => { if (typeof props.config.append === 'string') { return { + type: 'text', text: props.config.append, - type: 'button', handler: undefined, }; } - - if (props.config.append && typeof props.config.append === 'object') { - if (props.config.append.value === 0) { - return false; + if (typeof props.config.append === 'object') { + if (typeof props.config.append?.handler === 'function') { + return { + type: 'button', + text: props.config.append.text, + handler: props.config.append.handler, + }; } + if (props.config.append) { + if (props.config.append.value === 0) { + return false; + } - return props.config.append; + return props.config.append; + } } return false;