Skip to content

Commit 8bdeb09

Browse files
martinsotirovulivz
authored andcommitted
fix: pages number in the pagination plugin (#963)
1 parent 6e5bc66 commit 8bdeb09

File tree

1 file changed

+2
-2
lines changed
  • packages/@vuepress/plugin-pagination

1 file changed

+2
-2
lines changed

packages/@vuepress/plugin-pagination/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { path } = require('@vuepress/shared-utils')
22

33
function getIntervallers (max, interval) {
4-
const count = Math.floor(max / interval)
5-
const arr = [...Array(count + 1)]
4+
const count = max % interval === 0 ? Math.floor(max / interval) : Math.floor(max / interval) + 1
5+
const arr = [...Array(count)]
66
return arr.map((v, index) => {
77
const start = index * interval
88
const end = (index + 1) * interval - 1

0 commit comments

Comments
 (0)