调整generate输入框出现滚动条问题
This commit is contained in:
@@ -1074,10 +1074,10 @@ export default defineComponent({
|
||||
const scrollTop = textarea.scrollTop
|
||||
|
||||
// 2. 计算单行高度
|
||||
const lineHeight = parseInt(getComputedStyle(textarea).lineHeight) || 20 // 默认20px
|
||||
const lineHeight:any = parseInt(getComputedStyle(textarea).lineHeight) || 20 // 默认20px
|
||||
|
||||
// 3. 重置高度为1行
|
||||
textarea.style.height = lineHeight + 'px'
|
||||
textarea.style.height = (parseInt(lineHeight)+4) + 'px'
|
||||
|
||||
// 4. 计算实际需要的高度
|
||||
const newHeight = Math.max(lineHeight, textarea.scrollHeight)
|
||||
|
||||
Reference in New Issue
Block a user