mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Calendar): subtitle not updated in some cases (#6723)
This commit is contained in:
parent
5793481ba4
commit
89fdbf4729
@ -90,11 +90,14 @@ export default createComponent({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.height = this.$el.getBoundingClientRect().height;
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
getHeight() {
|
||||||
|
if (!this.height) {
|
||||||
|
this.height = this.$el.getBoundingClientRect().height;
|
||||||
|
}
|
||||||
|
return this.height;
|
||||||
|
},
|
||||||
|
|
||||||
scrollIntoView() {
|
scrollIntoView() {
|
||||||
if (this.showSubtitle) {
|
if (this.showSubtitle) {
|
||||||
this.$refs.days.scrollIntoView();
|
this.$refs.days.scrollIntoView();
|
||||||
|
@ -234,7 +234,7 @@ export default createComponent({
|
|||||||
const { body, months } = this.$refs;
|
const { body, months } = this.$refs;
|
||||||
const top = getScrollTop(body);
|
const top = getScrollTop(body);
|
||||||
const bottom = top + this.bodyHeight;
|
const bottom = top + this.bodyHeight;
|
||||||
const heights = months.map((item) => item.height);
|
const heights = months.map((item) => item.getHeight());
|
||||||
const heightSum = heights.reduce((a, b) => a + b, 0);
|
const heightSum = heights.reduce((a, b) => a + b, 0);
|
||||||
|
|
||||||
// iOS scroll bounce may exceed the range
|
// iOS scroll bounce may exceed the range
|
||||||
|
Loading…
x
Reference in New Issue
Block a user