我使用的是ui-select和bootstrap。如我们所知,bootstrap有input-lg,input-sm...但是有没有好的方法来改变ui-select的大小呢?
发布于 2015-09-23 16:04:03
你能告诉我对你来说什么是“好方法”吗?如果CSS足够好,那么你可以用它设置元素的样式,看起来就像这样。
.form-input-sm .ui-select-toggle {height: 40px}这是针对简单HTML的:
<ui-select theme="bootstrap" ng-model="model">
<ui-select-match placeholder="Placeholder"></ui-select-match>
<ui-select-choices refresh-delay="0" repeat="item in roleList">
<div>{{item.name}}</div>
</ui-select-choices>
</ui-select>我不是魔术师,我不知道选择器在这里只看HTML。如果你需要找到合适的选择器,你可以使用浏览器开发工具。例如,同样的技术被用来覆盖Bootstrap中的所有默认样式。
发布于 2022-01-13 11:35:42
我的回答可能晚了6年,但为了将来遇到这个问题的所有人,对我起作用的修复方法是使用内联css来设置ui-select的高度
<ui-select theme="bootstrap" style="min-height:34px" ng-model="model">
<ui-select-match placeholder="Placeholder"></ui-select-match>
<ui-select-choices refresh-delay="0" repeat="item in roleList">
<div>{{item.name}}</div>
</ui-select-choices>
</ui-select>https://stackoverflow.com/questions/32166551
复制相似问题