修改分页组件在部分场景中存在缓存问题导致部分数据无法查看的问题

This commit is contained in:
2024-08-08 10:30:55 +08:00
parent cf7756dd5c
commit b9e1b06d29
33 changed files with 56 additions and 886 deletions

View File

@@ -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
})
}