Commit d60f2bfa authored by daywrite's avatar daywrite

留言模块增加分页

parent 4bf9354c
......@@ -78,6 +78,11 @@
</div>
</li>
</ul>
<Pagenation
class="pull-right clearfix"
:pager.sync="result.pagenation"
:total="result.pagenation.totalcount">
</Pagenation>
</div>
</div>
</div>
......@@ -91,7 +96,13 @@ import {
api
} from '@/lib/commonMixin'
import { setModule } from '@/lib/viewHelper'
import Pagenation from './leaveMessagePagenation'
export default {
components: {
Pagenation
},
data () {
return {
is: false,
......@@ -99,7 +110,14 @@ export default {
secondTextBool: {},
secondArrayText: {},
model: {},
result: {}
result: {
list: [],
pagenation: {
totalcount: 1,
thispage: 1,
pagesize: 10
}
}
}
},
......@@ -179,7 +197,9 @@ export default {
let vm = this
let params = {
object_type: this.type,
object_id: this.model.id
object_id: this.model.id,
thispage: 1,
pagesize: 2
}
requestAPI(api.getCommentList, params)
.then((res) => {
......
<template>
<section>
<el-pagination v-if="total > 0" class="mb20 mt20"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pager.thispage"
:page-sizes="[2, 10, 20, 40, 60, 80, 100]"
:page-size="pager.pagesize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</section>
</template>
<script>
export default {
props: {
total: {
type: Number,
default: 0
}
},
data () {
return {
pager: {
thispage: 1,
pagesize: 10,
totalcount: 0
}
}
},
created () {
this.$emit('update:pager', this.pager)
},
methods: {
handleSizeChange (val) {
this.pager.thispage = 1
this.pager.pagesize = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
this.$parent.init()
},
handleCurrentChange (val) {
this.pager.page = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
this.$parent.init()
}
}
}
</script>
<style scoped>
</style>
......@@ -158,7 +158,6 @@ export default {
},
lmClose () {
console.log(1)
this.$refs.leaveMessage.isClose()
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment