@vuepress/plugin-pagination

分页器插件

安装

yarn add -D @vuepress/plugin-pagination
# OR npm install -D @vuepress/plugin-pagination

使用

module.exports = {
  plugins: ['@vuepress/pagination'] 
}

选项

postsFilter

  • 类型: function
  • 默认值:
(({ type }) => type === 'post')`

postsSorter

  • 类型: function
  • 默认值:
((prev, next) => {
  const prevTime = new Date(prev.frontmatter.date).getTime()
  const nextTime = new Date(next.frontmatter.date).getTime()
  return prevTime - nextTime > 0 ? -1 : 1
})