mirror of
https://github.com/youzan/vant.git
synced 2025-10-17 16:44:21 +00:00
fix(NavBar): update placeholder height when window resized (#11351)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { useRect } from '@vant/use';
|
||||
import { Ref, ref, onMounted, nextTick } from 'vue';
|
||||
import { Ref, ref, onMounted, nextTick, watch } from 'vue';
|
||||
import { windowHeight, windowWidth } from '../utils';
|
||||
import { onPopupReopen } from './on-popup-reopen';
|
||||
|
||||
export const useHeight = (
|
||||
@@ -32,5 +33,9 @@ export const useHeight = (
|
||||
// https://github.com/vant-ui/vant/issues/10628
|
||||
onPopupReopen(() => nextTick(setHeight));
|
||||
|
||||
// The height of the element may change when the window is resized
|
||||
// https://github.com/youzan/vant/issues/11325
|
||||
watch([windowWidth, windowHeight], setHeight);
|
||||
|
||||
return height;
|
||||
};
|
||||
|
Reference in New Issue
Block a user