clrDgSingleSelected выдает ошибку в ясности версии 3 - PullRequest
0 голосов
/ 16 апреля 2020

Я создаю сетку данных с одним вариантом выбора, используя Clarity версии 3 и Angular 9., но это выдает ошибку "ОШИБКА TypeError: Невозможно прочитать свойство 'findIndex' из undefined в Selection.isLocked (clr- angular. js: 11557) ... "в библиотеке @ clr / angular и сетка данных не отображается. Ниже приведен фрагмент кода: app.component. html

  <clr-datagrid [(clrDgSingleSelected)]="selectedUser" [clrDgRowSelection]="true">
   <clr-dg-column>User ID</clr-dg-column>  
   <clr-dg-column>Name</clr-dg-column>
   <clr-dg-column>Favorite color</clr-dg-column>
   <clr-dg-row *ngFor="let user of users" [clrDgItem]="user">
     <clr-dg-cell>{{user.id}}</clr-dg-cell>
     <clr-dg-cell>{{user.name}}</clr-dg-cell>
     <clr-dg-cell>{{user.color}}</clr-dg-cell>
   </clr-dg-row> 
   <clr-dg-footer>{{users.length}} users</clr-dg-footer>
  </clr-datagrid>`

app.component.ts

import { Component } from '@angular/core';
@Component({
  selector: 'app-root',
   templateUrl: './app.component.html',
   styleUrls: ['./app.component.scss']
})
export class AppComponent {
 title = 'ang9VMC3POC';`
  users = [{
     id:"1",
     name:"test1",
    color:"red"
 },
{
 id:"2",
 name:"test2",
 color:"blue"
},
{
 id:"3",
 name:"test3",
 color:"green"
},
];
selectedUser = this.users[2];
}
...