Merge branch 'dev' into next

This commit is contained in:
chenjiahan 2020-07-07 15:03:14 +08:00
commit 0024a2db42
5 changed files with 15 additions and 10 deletions

View File

@ -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();

View File

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

View File

@ -1,4 +1,4 @@
import { createNamespace, isDef, addUnit } from '../utils'; import { createNamespace, isDef, addUnit, inBrowser } from '../utils';
import Icon from '../icon'; import Icon from '../icon';
const [createComponent, bem] = createNamespace('image'); const [createComponent, bem] = createNamespace('image');
@ -69,7 +69,7 @@ export default createComponent({
created() { created() {
const { $Lazyload } = this; const { $Lazyload } = this;
if ($Lazyload) { if ($Lazyload && inBrowser) {
$Lazyload.$on('loaded', this.onLazyLoaded); $Lazyload.$on('loaded', this.onLazyLoaded);
$Lazyload.$on('error', this.onLazyLoadError); $Lazyload.$on('error', this.onLazyLoadError);
} }

View File

@ -168,6 +168,7 @@ export default createComponent({
return; return;
} }
this.transitionEndTrigger = null;
this.duration = DEFAULT_DURATION; this.duration = DEFAULT_DURATION;
this.setIndex(index, true); this.setIndex(index, true);
}, },

View File

@ -1,9 +1,10 @@
// import Vue from 'vue'; import Vue from 'vue';
// export { createNamespace } from './create'; export { createNamespace } from './create';
export { addUnit } from './format/unit'; export { addUnit } from './format/unit';
// export const isServer: boolean = Vue.prototype.$isServer; export const inBrowser = typeof window !== 'undefined';
export const isServer: boolean = Vue.prototype.$isServer;
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function
export function noop() {} export function noop() {}