【问题标题】:ng-disabled option in angular ui-select shrinks the text boxangular ui-select 中的 ng-disabled 选项缩小文本框
【发布时间】:2015-01-02 05:54:01
【问题描述】:

我正在使用 angular ui-select 指令并尝试使用 ng-disabled 选项禁用它。

<ui-select multiple ng-model="address.selected"
             theme="bootstrap"
             ng-disabled="true"
             reset-search-input="true"
             style="width: 300px;">

这里是 plunker http://plnkr.co/edit/julETCG4zCGAxFJ0PSBF?p=preview

文本框的大小随着 ng-disabled="true" 缩小。

【问题讨论】:

  • 您的 plunkr 在控制台中存在错误,导致其无法运行。

标签: javascript angularjs angular-ui ui-select2


【解决方案1】:

themebootstrap更新为select2,如下所示:

<ui-select multiple ng-model="address.selected"
         theme="select2"
         ng-disabled="true"
         reset-search-input="true"
         style="width: 300px;">

如果您想要 bootstrap 主题,请将其添加到样式中:

.ui-select-multiple.ui-select-bootstrap {
    min-height: 34px;        
    height: auto;
    padding: .3em;
}

如图here

【讨论】:

  • 这对我来说意义重大。谢谢
猜你喜欢
  • 1970-01-01
  • 2018-02-24
  • 2014-12-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多