diff --git a/src/packages/__VUE/input/index.taro.vue b/src/packages/__VUE/input/index.taro.vue index 882ad91140..ff87ed778f 100644 --- a/src/packages/__VUE/input/index.taro.vue +++ b/src/packages/__VUE/input/index.taro.vue @@ -329,8 +329,6 @@ export default create({ value = value.slice(0, Number(props.maxLength)); } updateValue(value); - emit('update:modelValue', value, event); - emit('change', value, event); }; const updateValue = (value: string, trigger: import('./type').InputFormatTrigger = 'onChange') => { @@ -428,16 +426,20 @@ export default create({ watch( () => props.modelValue, () => { - updateValue(getModelValue()); - resetValidation(); + if (!slots.input) { + updateValue(getModelValue()); + resetValidation(); + } } ); onMounted(() => { - if (props.autofocus) { - inputRef.value.focus(); + if (!slots.input) { + if (props.autofocus) { + inputRef.value.focus(); + } + updateValue(getModelValue(), props.formatTrigger); } - updateValue(getModelValue(), props.formatTrigger); }); return { diff --git a/src/packages/__VUE/input/index.vue b/src/packages/__VUE/input/index.vue index ce9e0a232e..80d02edf90 100644 --- a/src/packages/__VUE/input/index.vue +++ b/src/packages/__VUE/input/index.vue @@ -425,13 +425,17 @@ export default create({ watch( () => props.modelValue, () => { - updateValue(getModelValue()); - resetValidation(); + if (!slots.input) { + updateValue(getModelValue()); + resetValidation(); + } } ); onMounted(() => { - updateValue(getModelValue(), props.formatTrigger); + if (!slots.input) { + updateValue(getModelValue(), props.formatTrigger); + } }); return {