fix(input): Improve inputStyle reference (#2780)

This commit is contained in:
Aex 2021-08-01 16:04:30 +08:00 committed by GitHub
parent e6013c1e41
commit 0f2181abc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,6 +251,7 @@ export default defineComponent({
const validateState = computed(() => elFormItem.validateState || '')
const validateIcon = computed(() => VALIDATE_STATE_MAP[validateState.value])
const computedTextareaStyle = computed(() => ({
...props.inputStyle,
..._textareaCalcStyle.value,
resize: props.resize,
}))
@ -294,12 +295,10 @@ export default defineComponent({
const minRows = isObject(autosize) ? autosize.minRows : void 0
const maxRows = isObject(autosize) ? autosize.maxRows : void 0
_textareaCalcStyle.value = {
...props.inputStyle,
...calcTextareaHeight(textarea.value, minRows, maxRows),
}
} else {
_textareaCalcStyle.value = {
...props.inputStyle,
minHeight: calcTextareaHeight(textarea.value).minHeight,
}
}