fix: pagation
This commit is contained in:
parent
70e615df59
commit
d5529b87c4
@ -23,11 +23,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
data: {
|
total: {
|
||||||
type: Array,
|
type: Number,
|
||||||
default () {
|
default: 10
|
||||||
return []
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
perPage: {
|
perPage: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@ -40,7 +38,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
pages () {
|
pages () {
|
||||||
return Math.ceil(this.data.length / this.perPage)
|
return Math.ceil(this.total / this.perPage)
|
||||||
},
|
},
|
||||||
show:function(){
|
show:function(){
|
||||||
return this.pages && this.pages !=1
|
return this.pages && this.pages !=1
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<pagation
|
<pagation
|
||||||
class="pagation"
|
class="pagation"
|
||||||
:data="posts"
|
:total="posts.length"
|
||||||
:currentPage="currentPage"
|
:currentPage="currentPage"
|
||||||
@getCurrentPage="getCurrentPage"></pagation>
|
@getCurrentPage="getCurrentPage"></pagation>
|
||||||
</Common>
|
</Common>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<pagation
|
<pagation
|
||||||
class="pagation"
|
class="pagation"
|
||||||
:data="posts"
|
:total="posts.length"
|
||||||
:currentPage="currentPage"
|
:currentPage="currentPage"
|
||||||
@getCurrentPage="getCurrentPage"></pagation>
|
@getCurrentPage="getCurrentPage"></pagation>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user