【问题标题】:Change input field height based on the content inside in Bootstrap根据 Bootstrap 中的内容更改输入字段高度
【发布时间】:2020-01-03 09:31:20
【问题描述】:

我正在尝试将内容放入引导输入字段中,但它甚至没有绑定。请找到我需要在内容大小增加时调整高度的代码行。

<input type="text" autocomplete="off" class="form-control" 
name="typeOfOwnership"  
[(ngModel)]="newJson?.basicDetails.typeOfOwnership[0].typeOfOwnershipName" 
readonly>

【问题讨论】:

  • 你的意思是你的内容在多行运行是吗?
  • 你是什么意思改变输入的高度?随着内容宽度的增加大小不能改变高度,对吗?否则,如果您想使用,可以将 textArea 用于多行。

标签: angular twitter-bootstrap input word-wrap


【解决方案1】:

当您的内容较大时,您应该改用 Textarea

试试这个

<textarea [(ngModel)]="newJson?.basicDetails.typeOfOwnership[0].typeOfOwnershipName" readonly></textarea>

【讨论】:

    猜你喜欢
    • 2013-03-06
    • 2020-02-10
    • 2022-07-16
    • 1970-01-01
    • 1970-01-01
    • 2012-09-28
    • 1970-01-01
    • 2013-08-19
    • 2019-12-03
    相关资源
    最近更新 更多