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