mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Improve DataTable demo performance
This commit is contained in:
parent
69d9c0875b
commit
27db388223
48 changed files with 1560 additions and 1366 deletions
|
@ -6,15 +6,17 @@
|
|||
</p>
|
||||
<p>In this example, <strong>100000</strong> preloaded records are rendered by the Table.</p>
|
||||
</DocSectionText>
|
||||
<div class="card">
|
||||
<DataTable :value="cars" scrollable scrollHeight="400px" :virtualScrollerOptions="{ itemSize: 46 }" tableStyle="min-width: 50rem">
|
||||
<Column field="id" header="Id" style="width: 20%"></Column>
|
||||
<Column field="vin" header="Vin" style="width: 20%"></Column>
|
||||
<Column field="year" header="Year" style="width: 20%"></Column>
|
||||
<Column field="brand" header="Brand" style="width: 20%"></Column>
|
||||
<Column field="color" header="Color" style="width: 20%"></Column>
|
||||
</DataTable>
|
||||
</div>
|
||||
<DeferredDemo @load="loadDemoData">
|
||||
<div class="card">
|
||||
<DataTable :value="cars" scrollable scrollHeight="400px" :virtualScrollerOptions="{ itemSize: 46 }" tableStyle="min-width: 50rem">
|
||||
<Column field="id" header="Id" style="width: 20%"></Column>
|
||||
<Column field="vin" header="Vin" style="width: 20%"></Column>
|
||||
<Column field="year" header="Year" style="width: 20%"></Column>
|
||||
<Column field="brand" header="Brand" style="width: 20%"></Column>
|
||||
<Column field="color" header="Color" style="width: 20%"></Column>
|
||||
</DataTable>
|
||||
</div>
|
||||
</DeferredDemo>
|
||||
<DocSectionCode :code="code" :service="['CarService']" />
|
||||
</template>
|
||||
|
||||
|
@ -98,8 +100,10 @@ onMounted(() => {
|
|||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.cars = Array.from({ length: 100000 }).map((_, i) => CarService.generateCar(i + 1));
|
||||
methods: {
|
||||
loadDemoData() {
|
||||
this.cars = Array.from({ length: 100000 }).map((_, i) => CarService.generateCar(i + 1));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue