From 89fdbf4729bf9c3198eb11d3d53448ecef29917f Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 7 Jul 2020 14:44:20 +0800 Subject: [PATCH 1/3] fix(Calendar): subtitle not updated in some cases (#6723) --- src/calendar/components/Month.js | 11 +++++++---- src/calendar/index.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/calendar/components/Month.js b/src/calendar/components/Month.js index 2703fbec1..50280034f 100644 --- a/src/calendar/components/Month.js +++ b/src/calendar/components/Month.js @@ -90,11 +90,14 @@ export default createComponent({ }, }, - mounted() { - this.height = this.$el.getBoundingClientRect().height; - }, - methods: { + getHeight() { + if (!this.height) { + this.height = this.$el.getBoundingClientRect().height; + } + return this.height; + }, + scrollIntoView() { if (this.showSubtitle) { this.$refs.days.scrollIntoView(); diff --git a/src/calendar/index.js b/src/calendar/index.js index 1fa30530e..e05b3a13a 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -234,7 +234,7 @@ export default createComponent({ const { body, months } = this.$refs; const top = getScrollTop(body); 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); // iOS scroll bounce may exceed the range From 710208eee064d2df9b2370b7a1be7144c7a4c65c Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 7 Jul 2020 14:58:59 +0800 Subject: [PATCH 2/3] fix(Image): memory leak during SSR (#6721) --- src/image/index.js | 4 ++-- src/utils/index.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/image/index.js b/src/image/index.js index 4f426b951..0b16ebb83 100644 --- a/src/image/index.js +++ b/src/image/index.js @@ -1,4 +1,4 @@ -import { createNamespace, isDef, addUnit } from '../utils'; +import { createNamespace, isDef, addUnit, inBrowser } from '../utils'; import Icon from '../icon'; const [createComponent, bem] = createNamespace('image'); @@ -69,7 +69,7 @@ export default createComponent({ created() { const { $Lazyload } = this; - if ($Lazyload) { + if ($Lazyload && inBrowser) { $Lazyload.$on('loaded', this.onLazyLoaded); $Lazyload.$on('error', this.onLazyLoadError); } diff --git a/src/utils/index.ts b/src/utils/index.ts index b17f4eabc..83f5ff38b 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -3,6 +3,7 @@ import Vue from 'vue'; export { createNamespace } from './create'; export { addUnit } from './format/unit'; +export const inBrowser = typeof window !== 'undefined'; export const isServer: boolean = Vue.prototype.$isServer; // eslint-disable-next-line @typescript-eslint/no-empty-function From 9045248523edf4cc051c0be404f316e0dbe2b382 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 7 Jul 2020 15:01:20 +0800 Subject: [PATCH 3/3] fix(Picker): click during momentum case incorrect result (#6724) --- src/picker/PickerColumn.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/picker/PickerColumn.js b/src/picker/PickerColumn.js index e6a91317e..758558389 100644 --- a/src/picker/PickerColumn.js +++ b/src/picker/PickerColumn.js @@ -168,6 +168,7 @@ export default createComponent({ return; } + this.transitionEndTrigger = null; this.duration = DEFAULT_DURATION; this.setIndex(index, true); },