mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-04 14:01:05 +08:00
Compare commits
3 Commits
7eaefd04fa
...
04494a450d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04494a450d | ||
|
|
e5cc32ca97 | ||
|
|
c3776877ca |
@ -185,10 +185,6 @@ export default defineComponent({
|
||||
const months: Date[] = [];
|
||||
const cursor = new Date(props.minDate);
|
||||
|
||||
if (props.lazyRender && !props.show && props.poppable) {
|
||||
return months;
|
||||
}
|
||||
|
||||
cursor.setDate(1);
|
||||
|
||||
do {
|
||||
@ -299,7 +295,9 @@ export default defineComponent({
|
||||
props.type === 'single'
|
||||
? (currentDate.value as Date)
|
||||
: (currentDate.value as Date[])[0];
|
||||
scrollToDate(targetDate);
|
||||
if (isDate(targetDate)) {
|
||||
scrollToDate(targetDate);
|
||||
}
|
||||
} else {
|
||||
raf(onScroll);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { useRect } from '@vant/use';
|
||||
import { Ref, ref, onMounted, nextTick } from 'vue';
|
||||
import { onPopupReopen } from './on-popup-reopen';
|
||||
|
||||
export const useHeight = (
|
||||
element: Element | Ref<Element | undefined>,
|
||||
@ -25,5 +26,11 @@ export const useHeight = (
|
||||
}
|
||||
});
|
||||
|
||||
// The result of useHeight might be 0 when the popup is hidden,
|
||||
// so we need to reset the height when the popup is reopened.
|
||||
// IntersectionObserver is a better solution, but it is not supported by legacy browsers.
|
||||
// https://github.com/vant-ui/vant/issues/10628
|
||||
onPopupReopen(() => nextTick(setHeight));
|
||||
|
||||
return height;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user