From b3432683a78e41eb9fa14289f9c323ed9c470192 Mon Sep 17 00:00:00 2001 From: zhangyh Date: Wed, 12 Nov 2025 14:43:29 +0800 Subject: [PATCH] =?UTF-8?q?style:=20textarea=E4=BF=AE=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E9=9A=8F=E9=AB=98=E5=BA=A6=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/home/tools/toProduct/index.vue | 50 +++++++++++--------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/component/home/tools/toProduct/index.vue b/src/component/home/tools/toProduct/index.vue index 2a3dfb2d..179c6f68 100644 --- a/src/component/home/tools/toProduct/index.vue +++ b/src/component/home/tools/toProduct/index.vue @@ -166,13 +166,13 @@ @keydown.enter.prevent="getPrductimg()" v-model="searchName[productimgMenu.value]" > +
+ + {{ $t('ProductImg.PromptAssit') }} +
-
- - {{ $t('ProductImg.PromptAssit') }} -
@@ -1036,17 +1036,21 @@ export default defineComponent({ }) } const ifMaximumLength = async () => { - await nextTick() + // await nextTick() + // let textarea = productImgData.textarea + // const scrollTop = textarea.scrollTop + // // 2. 计算单行高度 + // const lineHeight = parseInt(getComputedStyle(textarea).lineHeight) || 20 // 默认20px + // // 3. 重置高度为1行 + // textarea.style.height = lineHeight + 'px' + // // 4. 计算实际需要的高度 + // const newHeight = Math.max(lineHeight, textarea.scrollHeight) + // textarea.style.height = newHeight + 'px' + // textarea.scrollTop = scrollTop + // 随着输入内容自动调整高度 let textarea = productImgData.textarea - const scrollTop = textarea.scrollTop - // 2. 计算单行高度 - const lineHeight = parseInt(getComputedStyle(textarea).lineHeight) || 20 // 默认20px - // 3. 重置高度为1行 - textarea.style.height = lineHeight + 'px' - // 4. 计算实际需要的高度 - const newHeight = Math.max(lineHeight, textarea.scrollHeight) - textarea.style.height = newHeight + 'px' - textarea.scrollTop = scrollTop + textarea.style.height = 'auto' + textarea.style.height = textarea.scrollHeight + 'px' } const openSpeed = () => { speed.speedState = !speed.speedState @@ -1562,19 +1566,18 @@ export default defineComponent({ .input_border { padding-bottom: 0; .input_box { - .input_box_btnBox .textarea { - min-height: 12.7rem; + .input_box_btnBox { + position: relative; + .textarea { + min-height: 12.7rem; + max-height: none; + } } } } - .input_box_btnBox { - padding-bottom: 4rem; - } .asistant-btn { - // width: 9rem; - padding: 0.45rem 0.6rem; height: 2.3rem; - line-height: 2.3rem; + padding: 0 0.6rem; font-size: 1rem; font-weight: 400; color: #313131; @@ -1591,6 +1594,9 @@ export default defineComponent({ cursor: pointer; .asistant-icon { font-size: 1rem; + margin-right: 0; + width: initial; + // margin-top: -0.2rem; } } }