From 49ca14fecd7fcf1714acec08346640b32c3bc9d1 Mon Sep 17 00:00:00 2001 From: afe1 <56245609+pzzyf@users.noreply.github.com> Date: Thu, 4 Jan 2024 20:52:17 +0800 Subject: [PATCH] fix(components): [input] remove useless contants (#15351) * fix(components): [input] remove useless contants * fix: remove useless contants --- packages/components/input/src/input.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/components/input/src/input.vue b/packages/components/input/src/input.vue index 0fe9d50553..5d1223f3c0 100644 --- a/packages/components/input/src/input.vue +++ b/packages/components/input/src/input.vue @@ -41,8 +41,8 @@ :aria-label="label" :placeholder="placeholder" :style="inputStyle" - :form="props.form" - :autofocus="props.autofocus" + :form="form" + :autofocus="autofocus" @compositionstart="handleCompositionStart" @compositionupdate="handleCompositionUpdate" @compositionend="handleCompositionEnd" @@ -118,8 +118,8 @@ :style="textareaStyle" :aria-label="label" :placeholder="placeholder" - :form="props.form" - :autofocus="props.autofocus" + :form="form" + :autofocus="autofocus" @compositionstart="handleCompositionStart" @compositionupdate="handleCompositionUpdate" @compositionend="handleCompositionEnd" @@ -235,9 +235,9 @@ const attrs = useAttrs({ return Object.keys(containerAttrs.value) }), }) -const { form, formItem } = useFormItem() +const { form: elForm, formItem: elFormItem } = useFormItem() const { inputId } = useFormItemInputId(props, { - formItemContext: formItem, + formItemContext: elFormItem, }) const inputSize = useFormSize() const inputDisabled = useFormDisabled() @@ -260,14 +260,14 @@ const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController( { afterBlur() { if (props.validateEvent) { - formItem?.validate?.('blur').catch((err) => debugWarn(err)) + elFormItem?.validate?.('blur').catch((err) => debugWarn(err)) } }, } ) -const needStatusIcon = computed(() => form?.statusIcon ?? false) -const validateState = computed(() => formItem?.validateState || '') +const needStatusIcon = computed(() => elForm?.statusIcon ?? false) +const validateState = computed(() => elFormItem?.validateState || '') const validateIcon = computed( () => validateState.value && ValidateComponentsMap[validateState.value] ) @@ -490,7 +490,7 @@ watch( () => { nextTick(() => resizeTextarea()) if (props.validateEvent) { - formItem?.validate?.('change').catch((err) => debugWarn(err)) + elFormItem?.validate?.('change').catch((err) => debugWarn(err)) } } )