File tree Expand file tree Collapse file tree 3 files changed +6
-8
lines changed
Expand file tree Collapse file tree 3 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,9 @@ export default {
2323 }
2424 },
2525 props: {
26- data: {
27- type: Array ,
28- default () {
29- return []
30- }
26+ total: {
27+ type: Number ,
28+ default: 10
3129 },
3230 perPage: {
3331 type: Number ,
@@ -40,7 +38,7 @@ export default {
4038 },
4139 computed: {
4240 pages () {
43- return Math .ceil (this .data . length / this .perPage )
41+ return Math .ceil (this .total / this .perPage )
4442 },
4543 show : function (){
4644 return this .pages && this .pages != 1
Original file line number Diff line number Diff line change 2626 <!-- 分页 -->
2727 <pagation
2828 class =" pagation"
29- :data =" posts"
29+ :total =" posts.length "
3030 :currentPage =" currentPage"
3131 @getCurrentPage =" getCurrentPage" ></pagation >
3232 </Common >
Original file line number Diff line number Diff line change 1818
1919 <pagation
2020 class =" pagation"
21- :data =" posts"
21+ :total =" posts.length "
2222 :currentPage =" currentPage"
2323 @getCurrentPage =" getCurrentPage" ></pagation >
2424 </div >
You can’t perform that action at this time.
0 commit comments