chore:H5和微信小程序的返回第一个一级标题时右侧高度正确更新。
This commit is contained in:
@@ -646,6 +646,9 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
oneCategoryHeight: function () {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
oneCategorySelect: function () {
|
||||
this.scrollTop = -1;
|
||||
this.goodsList = [];
|
||||
|
||||
@@ -537,20 +537,20 @@ export default {
|
||||
this.getOneCategoryItemHeight(index);
|
||||
},
|
||||
getOneCategoryItemHeight(index) {
|
||||
if (!query || typeof query.selectAll !== 'function') {
|
||||
query = uni.createSelectorQuery && uni.createSelectorQuery().in(this);
|
||||
}
|
||||
if (!query || typeof query.selectAll !== 'function') {
|
||||
return;
|
||||
}
|
||||
query
|
||||
.selectAll('.category-item-wrap .category-item')
|
||||
.boundingClientRect(data => {
|
||||
if (data && data.length > index && data[index].height) {
|
||||
this.oneCategoryItemHeight = data[index].height;
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
setTimeout(() => {
|
||||
const newQuery = uni.createSelectorQuery && uni.createSelectorQuery().in(this);
|
||||
if (!newQuery || typeof newQuery.selectAll !== 'function') {
|
||||
return;
|
||||
}
|
||||
newQuery
|
||||
.selectAll('.category-item-wrap .category-item')
|
||||
.boundingClientRect(data => {
|
||||
if (data && data.length > index && data[index].height) {
|
||||
this.oneCategoryItemHeight = data[index].height;
|
||||
}
|
||||
})
|
||||
.exec();
|
||||
}, 200);
|
||||
},
|
||||
saveSecondCategoryName(name) {
|
||||
this.lastSecondCategoryName = name;
|
||||
|
||||
Reference in New Issue
Block a user