我正在从 Nativescript@6/Angular@8 迁移到 Nativescript@7/Angular10。在我的应用程序中,我使用了库nativescript-ui-listview@9.10.0。我想使用groupingFunction
.
groupingFunction(payment: Payment) {
return payment.group.name;
}
和 HTML 文件:
<RadListView height="100%" class="unpaid-payments__content" [items]="payments" [groupingFunction]="groupingFunction">
<ng-template tkListItemTemplate let-item="item" let-i="index">
<StackLayout class="unpaid-payments__item">
<tb-unpaid-payment
[payment]="item"
[userId]="userId"
(pay)="onPay($event)"
(payWithVenmo)="onPayWithVenmo($event)"
(remind)="onRemind($event)"
></tb-unpaid-payment>
</StackLayout>
</ng-template>
<ng-template tkGroupTemplate let-category="category">
<GridLayout rows="auto" class="unpaid-payments__header">
<label row="0" class="unpaid-payments__header-title" [text]="category"></label>
</GridLayout>
</ng-template>
</RadListView>
iOS出现问题,但Android正常工作
日志:CONSOLE ERROR: ERROR Error: attempt to insert item 1 into section 0, but there are only 1 item in section 0 after the update