修改分页组件在部分场景中存在缓存问题导致部分数据无法查看的问题
This commit is contained in:
@@ -5,10 +5,26 @@ Component({
|
||||
properties: {
|
||||
currentIndex: { //当前页码
|
||||
type: Number,
|
||||
value: 1
|
||||
value: 1,
|
||||
observer(newVal,oldVal) {// 数据监听
|
||||
const that = this;
|
||||
this.setData({
|
||||
index: newVal
|
||||
}, () => {
|
||||
that.updateBtnDis();
|
||||
})
|
||||
},
|
||||
},
|
||||
totalPage: {
|
||||
type: Number
|
||||
type: Number,
|
||||
observer(newVal,oldVal) {// 数据监听
|
||||
const that = this;
|
||||
this.setData({
|
||||
total: newVal
|
||||
}, () => {
|
||||
that.updateBtnDis();
|
||||
})
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -124,17 +140,17 @@ Component({
|
||||
})
|
||||
}else if (index == total) { // 最后一页
|
||||
this.setData({
|
||||
nextBtnDis: true
|
||||
nextBtnDis: true,
|
||||
prevBtnDis: false,
|
||||
})
|
||||
} else if (index == 1){ // 第一页
|
||||
this.setData({
|
||||
prevBtnDis: true
|
||||
prevBtnDis: true,
|
||||
nextBtnDis: false,
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
prevBtnDis: false
|
||||
})
|
||||
this.setData({
|
||||
prevBtnDis: false,
|
||||
nextBtnDis: false
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user