mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [input] use v-if throw exception (#11187)
* fix(components): [input] use v-if throw exception * fix(components): [input] remove the non-null assertion
This commit is contained in:
@@ -327,17 +327,17 @@ useResizeObserver(textarea, (entries) => {
|
||||
const resizeTextarea = () => {
|
||||
const { type, autosize } = props
|
||||
|
||||
if (!isClient || type !== 'textarea') return
|
||||
if (!isClient || type !== 'textarea' || !textarea.value) return
|
||||
|
||||
if (autosize) {
|
||||
const minRows = isObject(autosize) ? autosize.minRows : undefined
|
||||
const maxRows = isObject(autosize) ? autosize.maxRows : undefined
|
||||
textareaCalcStyle.value = {
|
||||
...calcTextareaHeight(textarea.value!, minRows, maxRows),
|
||||
...calcTextareaHeight(textarea.value, minRows, maxRows),
|
||||
}
|
||||
} else {
|
||||
textareaCalcStyle.value = {
|
||||
minHeight: calcTextareaHeight(textarea.value!).minHeight,
|
||||
minHeight: calcTextareaHeight(textarea.value).minHeight,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user