VUE 3的Element-Plus输入组件

发布于 2025-01-30 19:16:01 字数 1186 浏览 0 评论 0原文

当我使用element Plus为VUE 3创建的输入(TextArea)自动化输入(TextArea)时,在文本到达键入线的末尾之前,将创建一个新行。这使得输入框不必要地很大,并且文本后有不需要的空白。

这是这个问题的视频演示

这是我的代码这是我的代码组件:

<template>
        <el-input
                :autosize="{ minRows: 1, maxRows: 16 }"
                type='textarea' 
                :input-style="{
                        
                        border: '0px',
                        fontSize: 'large',
                        paddingTop:'15px',
                        paddingBottom:'15px',
                        borderRadius:'0',
                        backgroundColor: 'transparent',
                        minWidth: '100%'                      

                }"
                
            />
 
</template>

<script>


</script>

<style>

</style>

这是文档 https://element-plus.org/en-us/component/inpuent/inpuent/input。 html

有什么想法如何解决?谢谢。

When autosizing an input (textarea) I’ve created with Element Plus for Vue 3, a new line is created before the text reaches the end of the line being typed. This makes the input box unnecessarily large, and there’s unneeded white space after the text.

Here's a video demo of the issue

Here's my code for the component:

<template>
        <el-input
                :autosize="{ minRows: 1, maxRows: 16 }"
                type='textarea' 
                :input-style="{
                        
                        border: '0px',
                        fontSize: 'large',
                        paddingTop:'15px',
                        paddingBottom:'15px',
                        borderRadius:'0',
                        backgroundColor: 'transparent',
                        minWidth: '100%'                      

                }"
                
            />
 
</template>

<script>


</script>

<style>

</style>

And here's the docs
https://element-plus.org/en-US/component/input.html

Any ideas how to fix? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执手闯天涯 2025-02-06 19:16:01

我认为您需要在组件中添加“行”属性

  <el-input
    v-model="textarea"
    :rows="2" //This will keep your textarea at the same height
    type="textarea"
    placeholder="Please input"
  />

I think you need to add a "row" attribute to your component

  <el-input
    v-model="textarea"
    :rows="2" //This will keep your textarea at the same height
    type="textarea"
    placeholder="Please input"
  />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文