From 2e678efce1dec8614a3d190ae396d821231a4be3 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Fri, 24 May 2019 14:03:29 +0300 Subject: [PATCH] Add lazy loading support to DataView --- src/components/dataview/DataView.vue | 10 +++++-- src/views/dataview/DataViewDemo.vue | 2 +- src/views/dataview/DataViewDoc.vue | 43 ++++++++++++++++++++++++++-- 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/components/dataview/DataView.vue b/src/components/dataview/DataView.vue index fa530029d..d4af3f329 100644 --- a/src/components/dataview/DataView.vue +++ b/src/components/dataview/DataView.vue @@ -196,10 +196,14 @@ data = this.sort(); } - if (this.paginator) - return data.slice(this.d_first, this.d_first + this.d_rows); - else + if (this.paginator) { + const first = this.lazy ? 0 : this.d_first; + return data.slice(first, first + this.d_rows); + } + else { return data; + } + } else { return null; diff --git a/src/views/dataview/DataViewDemo.vue b/src/views/dataview/DataViewDemo.vue index 81f0c6c2d..c6b65d469 100644 --- a/src/views/dataview/DataViewDemo.vue +++ b/src/views/dataview/DataViewDemo.vue @@ -9,7 +9,7 @@

Default

- +