File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export default {
1919 watch : {
2020 filter ( ) {
2121 this . $nextTick ( ( ) => {
22- this . setPagination ( { page : 1 } )
22+ this . setPagination ( { page : 1 } , true )
2323 } )
2424 }
2525 }
Original file line number Diff line number Diff line change 11import extend from '../../utils/extend'
22
3- function paginationChanged ( oldPag , newPag ) {
3+ function samePagination ( oldPag , newPag ) {
44 for ( let prop in newPag ) {
55 if ( newPag [ prop ] !== oldPag [ prop ] ) {
6- return true
6+ return false
77 }
88 }
9- return false
9+ return true
1010}
1111
1212function fixPagination ( p ) {
@@ -87,17 +87,24 @@ export default {
8787 }
8888 } ,
8989 methods : {
90- setPagination ( val ) {
90+ __sendServerRequest ( pagination ) {
91+ this . requestServerInteraction ( {
92+ pagination,
93+ filter : this . filter
94+ } )
95+ } ,
96+ setPagination ( val , forceServerRequest ) {
9197 const newPagination = fixPagination ( extend ( { } , this . computedPagination , val ) )
9298
93- if ( ! paginationChanged ( this . computedPagination , newPagination ) ) {
99+ if ( samePagination ( this . computedPagination , newPagination ) ) {
100+ if ( this . isServerSide && forceServerRequest ) {
101+ this . __sendServerRequest ( newPagination )
102+ }
94103 return
95104 }
96105
97106 if ( this . isServerSide ) {
98- this . requestServerInteraction ( {
99- pagination : newPagination
100- } )
107+ this . __sendServerRequest ( newPagination )
101108 return
102109 }
103110
You can’t perform that action at this time.
0 commit comments