gpt4 book ai didi

javascript - 如何在 Angular UI-Select 中自定义组标签

转载 作者:搜寻专家 更新时间:2023-10-31 08:16:22 24 4
gpt4 key购买 nike

在 Angular ui-select ( GitHub Link ) 中,如何自定义组标签?

enter image description here

如图所示,列表按国家/地区分组,如何自定义组标签使其大于选择项?

Plunker Example

<ui-select ng-model="person.selected" theme="bootstrap" ng-disabled="disabled" style="min-width: 300px;" title="Choose a person">
<ui-select-match placeholder="Select a person in the list or search his name/age...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices group-by="'country'" repeat="person in people | propsFilter: {name: $select.search, age: $select.search}">
<div ng-bind-html="person.name | highlight: $select.search"></div>
<small>
email: {{person.email}}
age: <span ng-bind-html="''+person.age | highlight: $select.search"></span>
</small>
</ui-select-choices>
</ui-select>

例子修改自官方例子link .

提前致谢。

最佳答案

我简单地定位了通过标签绑定(bind)到组的 CSS 类,如下所示:

.ui-select-choices-group-label {
font-size: 20px;
}

可以看到更新后的Plunkr here

关于javascript - 如何在 Angular UI-Select 中自定义组标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34136194/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com