我正在使用带有嵌套行的PrimeNG TurboTable。在将数据加载到 TurboTable 时会出现严重的性能问题,例如渲染大约需要 30 秒,需要 10 多秒才能变得稳定,数据是从服务器加载的,从服务器接收的数据非常快。有没有其他人遇到问题。如果是,您如何能够修复相同的问题。
.html
<p-table [value]="cars">
<ng-template pTemplate="header">
<tr>
<th>Vin</th>
<th>Year</th>
<th>Brand</th>
<th>Color</th>
</tr>
</ng-template>
<ng-template pTemplate="body" let-columns="columns" let-car>
<tr>
<td>{{car.vin}}</td>
<td>{{car.year}}</td>
<td>{{car.brand}}</td>
<td>
<ul>
<li *ngFor="let item of sales"
<a [ngClass]="{'active':car.order==item.order,'inactive':car.order > item.order}">
<i class="fa {{item.icon}}"></i>
</a>
</li>
</ul>
</td>
</tr>
</ng-template>
</p-table>
TS
this.cars =[
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "VW", "year": 2012, "color": "Orange", "vin": "dsad231ff","order"=10},
{"brand": "Audi", "year": 2011, "color": "Black", "vin": "gwregre345","order"=15},
{"brand": "Renault", "year": 2005, "color": "Gray", "vin": "h354htr","order"=24},
{"brand": "BMW", "year": 2003, "color": "Blue", "vin": "j6w54qgh","order"=2},
{"brand": "Mercedes", "year": 1995, "color": "Orange", "vin": "hrtwy34","order"=5},
{"brand": "Volvo", "year": 2005, "color": "Black", "vin": "jejtyj","order"=8},
{"brand": "Honda", "year": 2012, "color": "Yellow", "vin": "g43gr","order"=10},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
{"brand": "Ford", "year": 2000, "color": "Black", "vin": "h54hw5","order"=17},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=20},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=3},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=23},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=6},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=1},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=4},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=8},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=19},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=12},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=11},
{"brand": "Fiat", "year": 2013, "color": "Red", "vin": "245t2s","order"=24},
{"brand": "Jaguar", "year": 2013, "color": "Orange", "vin": "greg34","order"=15},
];
单独的列表
this.sales = [
{ brand: 'Apple', lastYearSale: '51%',thisYearProfit: '$43,342',"order"=1,"icon"="fa-flag-o" },
{ brand: 'Samsung', lastYearSale: '83%',thisYearProfit: '$312,122',"order"=2,"icon":"fa-address-card" },
{ brand: 'Microsoft', lastYearSale: '38%', thisYearProfit: '$8,500',"order"=3,"icon":"fa-eye" },
{ brand: 'Philips', lastYearSale: '49%',thisYearProfit: '$650,323',"order"=4,"icon":"fa-address-card" },
{ brand: 'Song', lastYearSale: '17%',thisYearProfit: '500,332' ,"order"=5,"icon":"fa-fax"},
{ brand: 'LG', lastYearSale: '52%',thisYearProfit: '$150,005',"order"=6,"icon":"fa-circle" },
{ brand: 'Sharp', lastYearSale: '82%',thisYearProfit: '$100,214' ,"order"=7,"icon":"fa-folder"},
{ brand: 'Panasonic', lastYearSale: '44%',thisYearProfit: '$53,322',"order"=8,"icon":"fa-address-book-o" },
{ brand: 'HTC', lastYearSale: '90%',thisYearProfit: '$296,232',"order"=9,"icon"="fa-bluetooth-b" },
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=10,"icon"="fa-address-book-o"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=11,"icon"="fa-bath"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=12,"icon"="fa-address-card"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=13,"icon"="fa-bluetooth-b"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=14,"icon"="fa-eye"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=15,"icon"="fa-circle"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=16,"icon"="fa-fax"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=17,"icon"="fa-address-book-o"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=18,"icon"="fa-address-card"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=19,"icon"="fa-bluetooth-b"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=20,"icon"="fa-eye"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=21,"icon"="fa-fax"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=22,"icon"="fa-circle"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=23,"icon"="fa-folder"},
{ brand: 'Toshiba', lastYearSale: '75%',thisYearProfit: '$12,533',"order"=24,"icon"="fa-flag-o"}
];
问题不在于 TurboTable,而在于最后一列,其中每行显示 3401 行的 24 个图标。
即使在桌子外面,显示 81624 图标也需要几秒钟的时间。要说服您,请尝试以下操作:
<div *ngFor="let car of cars">
<li *ngFor="let item of sales">
<i class="fa {{item.icon}}"></i>
</li>
</div>
您将遇到相同的性能问题。
为了解决您的问题,为什么不使用分页?这将非常快:
<p-table [value]="cars" sortField="brand" [paginator]="true" [rows]="10">
...
</p-table>
参见工作普伦克