From d5529b87c4a35a7c1d5b17e0382239929638ca92 Mon Sep 17 00:00:00 2001 From: reco_luan Date: Wed, 18 Sep 2019 19:39:04 +0800 Subject: [PATCH] fix: pagation --- components/Pagation.vue | 10 ++++------ layouts/Category.vue | 2 +- layouts/Tags.vue | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/Pagation.vue b/components/Pagation.vue index 6faabdd..da9b547 100644 --- a/components/Pagation.vue +++ b/components/Pagation.vue @@ -23,11 +23,9 @@ export default { } }, props: { - data: { - type: Array, - default () { - return [] - } + total: { + type: Number, + default: 10 }, perPage: { type: Number, @@ -40,7 +38,7 @@ export default { }, computed:{ pages () { - return Math.ceil(this.data.length / this.perPage) + return Math.ceil(this.total / this.perPage) }, show:function(){ return this.pages && this.pages !=1 diff --git a/layouts/Category.vue b/layouts/Category.vue index 8266a0c..749b9e2 100644 --- a/layouts/Category.vue +++ b/layouts/Category.vue @@ -26,7 +26,7 @@ diff --git a/layouts/Tags.vue b/layouts/Tags.vue index e1d2f4d..d250506 100644 --- a/layouts/Tags.vue +++ b/layouts/Tags.vue @@ -18,7 +18,7 @@