File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
packages/@vuepress-reco/vuepress-plugin-pagation Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ export default {
7676 } ,
7777 data ( ) {
7878 return {
79- changePage : '' // 跳转页
79+ changePage : '' , // 跳转页
80+ /* eslint-disable no-undef */
81+ pageSize : PERPAGE
8082 }
8183 } ,
8284 props : {
@@ -86,7 +88,7 @@ export default {
8688 } ,
8789 perPage : {
8890 type : Number ,
89- default : 2
91+ default : 10
9092 } ,
9193 currentPage : {
9294 type : Number ,
@@ -95,7 +97,8 @@ export default {
9597 } ,
9698 computed : {
9799 pages ( ) {
98- return Math . ceil ( this . total / this . perPage )
100+ const pageSize = this . pageSize || this . perPage
101+ return Math . ceil ( this . total / pageSize )
99102 } ,
100103 show : function ( ) {
101104 return this . pages && this . pages != 1
Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ import pagationLocales from './locales'
4747export default {
4848 data () {
4949 return {
50- changePage: ' ' // 跳转页
50+ changePage: ' ' , // 跳转页
51+ /* eslint-disable no-undef */
52+ pageSize: PERPAGE
5153 }
5254 },
5355 props: {
@@ -66,7 +68,8 @@ export default {
6668 },
6769 computed: {
6870 pages () {
69- return Math .ceil (this .total / this .perPage )
71+ const pageSize = this .pageSize || this .perPage
72+ return Math .ceil (this .total / pageSize)
7073 },
7174 show : function () {
7275 return this .pages && this .pages != 1
Original file line number Diff line number Diff line change 11const { path } = require ( '@vuepress/shared-utils' )
22
33module . exports = ( options , context ) => ( {
4+ define ( ) {
5+ const { perPage } = options || { }
6+ return {
7+ PERPAGE : perPage
8+ }
9+ } ,
410 name : '@vuepress-reco/vuepress-plugin-pagation' ,
511 enhanceAppFiles : [
612 path . resolve ( __dirname , './bin/enhanceAppFile.js' )
713 ]
8- } )
14+ } )
You can’t perform that action at this time.
0 commit comments