Skip to content

Commit fb84ff9

Browse files
author
weilei
committed
fix: 注释掉 Sender 组件中动态计算输入框高度的逻辑,以简化代码维护
1 parent 085c162 commit fb84ff9

File tree

1 file changed

+15
-15
lines changed
  • packages/element-x-ui/src/components/Sender/src

1 file changed

+15
-15
lines changed

packages/element-x-ui/src/components/Sender/src/main.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -432,21 +432,21 @@ export default {
432432
})
433433
434434
// 如果用户设置了字体大小,需要调整高度
435-
if (this.inputStyle.fontSize) {
436-
// 确保高度能完全容纳当前字体大小
437-
const computedFontSize = window.getComputedStyle(textareaEl).fontSize
438-
const fontSize = parseInt(computedFontSize)
439-
const minHeight = Math.max(fontSize * 1.5, 24) + 'px'
440-
textareaEl.style.minHeight = minHeight
441-
442-
// 重新触发 autosize
443-
this.$nextTick(() => {
444-
// 在某些情况下需要手动触发Element UI的autosize更新
445-
const event = document.createEvent('Event')
446-
event.initEvent('autosize:update', true, false)
447-
textareaEl.dispatchEvent(event)
448-
})
449-
}
435+
// if (this.inputStyle.fontSize) {
436+
// // 确保高度能完全容纳当前字体大小
437+
// const computedFontSize = window.getComputedStyle(textareaEl).fontSize
438+
// const fontSize = parseInt(computedFontSize)
439+
// const minHeight = Math.max(fontSize * 1.5, 24) + 'px'
440+
// textareaEl.style.minHeight = minHeight
441+
442+
// // 重新触发 autosize
443+
// this.$nextTick(() => {
444+
// // 在某些情况下需要手动触发Element UI的autosize更新
445+
// const event = document.createEvent('Event')
446+
// event.initEvent('autosize:update', true, false)
447+
// textareaEl.dispatchEvent(event)
448+
// })
449+
// }
450450
}
451451
},
452452

0 commit comments

Comments
 (0)