mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
Merge branch 'dev' into next
This commit is contained in:
commit
0024a2db42
@ -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
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
},
|
},
|
||||||
|
@ -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() {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user