11
This commit is contained in:
@@ -59,8 +59,9 @@
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page.sync="value.pageNum"
|
||||
:page-sizes="[5,10,20, 30, 50, 100]"
|
||||
:page-size="4"
|
||||
layout="prev, pager, next, jumper"
|
||||
layout="prev, pager, next,sizes, jumper"
|
||||
:total="value.total">
|
||||
</el-pagination>
|
||||
</el-col>
|
||||
@@ -78,8 +79,9 @@ export default {
|
||||
value: {
|
||||
type: Object,
|
||||
default: {
|
||||
//生命周期初始化问题
|
||||
data: []
|
||||
data: [{}],
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -107,21 +109,30 @@ export default {
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
console.log(`每页 ${val} 条`);
|
||||
if (val === -1) {
|
||||
this.value.pageSize = 1
|
||||
} else {
|
||||
this.value.pageSize = val
|
||||
}
|
||||
this.getData()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
if (val == -1) {
|
||||
if (val === -1) {
|
||||
this.value.pageNum = 1
|
||||
} else {
|
||||
this.value.pageNum = val
|
||||
}
|
||||
this.getData()
|
||||
},
|
||||
getData(){
|
||||
let data = {
|
||||
title: this.query,
|
||||
id: this.value.navId,
|
||||
pageNum: this.value.pageNum,
|
||||
pageSize: 5
|
||||
pageSize: this.value.pageSize
|
||||
}
|
||||
this.type = this.$route.query && this.$route.query.type
|
||||
if (this.type != null && this.type != 0) {
|
||||
if (this.type != null && this.type !== 0) {
|
||||
data.id = this.value.secondId
|
||||
} else {
|
||||
console.log(this.value);
|
||||
|
||||
Reference in New Issue
Block a user