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