dart - 如何为 ngFor 创建的每个项目创建材料弹出窗口?
问题描述
我正在尝试创建一个材料弹出选择,它允许我为我拥有的每个材料芯片更改一个变量。我的弹出/材质选择没有被复制。相反,它是每个芯片上的相同弹出窗口。statusDropdowns 包含 New、In Progress、On Hold、Complete 和 Cancelled。
我尝试更改弹出窗口和材料选择项的不同部分。我还在材料选择上尝试了 ngFor 并且只创建了一个下拉列表
<material-chips class="clickable chips" *ngFor="let t of taskList">
<material-chip
*ngIf="t.joinID == p.id"
[ngClass]="{'new': t.tStatus == 'New', 'inprogress': t.tStatus == 'In Progress', 'onhold': t.tStatus == 'On Hold', 'complete': t.tStatus == 'Complete', 'canceled': t.tStatus == 'Canceled'}"
[removable]="false"
popupSource
#source="popupSource"
buttonDecorator
(trigger)="showPopup(source)"
materialTooltip="{{t.genNotes}}"
(click)="onTaskSelect(t)"
[class.selected]="p === taskSelected">
<div>{{t.tName}}</div>
<div style="font-size: 10px">{{t.sTech}}</div>
<material-popup [source]="popSource"
[(visible)]="showingPopup"
[enforceSpaceConstraints]="false"
[preferredPositions]="[position]">
<div header style="background: lightblue; color: black; font-weight: bold; line-height: 1.8; text-align: center">
Select Project Status
</div>
<material-select width="2" class="bordered-list">
<material-select-item *ngFor="let s of statusDropdowns"
(trigger)="proto = s"
[selected]="proto == s">{{s}}</material-select-item>
</material-select>
</material-popup>
</material-chip>
</material-chips>
每个材料芯片的 t.tStatus 应该有一个单独的下拉列表。
解决方案
推荐阅读
- plugins - 大堂系统不工作?我的世界插件
- javascript - 评估 JavaScript 中的 if 语句
- reactjs - 出乎意料的'!在 'worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker'
- github - 克隆 github 存储库时如何解决错误
- python - 在 Spark DataFrame 中展平嵌套数组
- android - 有大数据问题的 Android 密钥库,我们使用 AES/GCM/NoPadding。在特定范围后抛出异常
- sql - 运行时错误代码 3709:从文件运行 SQL 查询并将数据粘贴到电子表格中
- julia - 如何在 VSCode 中看到与 RStudio“全局环境”相同的内容?
- python - 反验证码不起作用,在回调之前进行验证 - Selenium
- c# - 发票人 PDF 给出 null 但会员资格不给出 PDF null