angular - 如何在 mat-options 而不是 mat-optgroup 上添加搜索
问题描述
我找不到添加搜索选项的方法,因为我的 mat-option 在 mat-optgroup 中,有什么建议吗?
<mat-optgroup *ngIf="company.groups?.length" [label]="company.name" multiple>
<mat-option *ngFor="let group of company.groups; trackBy: trackById" [value]="group.id">
{{ group.name }}
</mat-option>
</mat-optgroup>
解决方案
如果您有兴趣在 mat-select 下拉面板控件中使用搜索文本框,请通过演示“mat-select-with-grouping-and-search” https://stackblitz.com/edit/select-group-search
推荐阅读
- c# - Discord.Net 如何在嵌入文本格式中转到下一行?
- python - sshtunnel python动态端口转发
- qt - QML 中的 UINavigationController 替换侧边菜单/抽屉
- r - 如何使用 r 中的传单在地图弹出窗口上显示词云
- opencl - 仅用于 OpenCL 的包含文件的典型后缀是什么?
- node.js - 在 Vercel 上部署 Next.js 应用程序时构造 Graphql 模式和解析器时出错
- python - Python/pygame 应用程序在退出()后没有响应
- logistic-regression - 如何在 JAGS 中实现加权逻辑回归?
- postman - Spotify — 通过 Postman 获取访问令牌(为我自己的用户)
- javascript - 如何在缩放中将双相关 x 轴条添加到高图表