From 8bdeb0948d3b3ffefc6dc119504949d1cf37075e Mon Sep 17 00:00:00 2001 From: Martin Sotirov Date: Mon, 29 Oct 2018 20:51:22 +0100 Subject: [PATCH] fix: pages number in the pagination plugin (#963) --- packages/@vuepress/plugin-pagination/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@vuepress/plugin-pagination/index.js b/packages/@vuepress/plugin-pagination/index.js index d078e4c0f3..bdacd07503 100644 --- a/packages/@vuepress/plugin-pagination/index.js +++ b/packages/@vuepress/plugin-pagination/index.js @@ -1,8 +1,8 @@ const { path } = require('@vuepress/shared-utils') function getIntervallers (max, interval) { - const count = Math.floor(max / interval) - const arr = [...Array(count + 1)] + const count = max % interval === 0 ? Math.floor(max / interval) : Math.floor(max / interval) + 1 + const arr = [...Array(count)] return arr.map((v, index) => { const start = index * interval const end = (index + 1) * interval - 1