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