🐛(component): [dropdown]下拉面板大小变化时自适应位置
This commit is contained in:
parent
a99cc5a204
commit
5aa8c63d00
@ -9,14 +9,11 @@ import "./index.less";
|
||||
import {
|
||||
CSSProperties,
|
||||
nextTick,
|
||||
onUpdated,
|
||||
provide,
|
||||
ref,
|
||||
shallowRef,
|
||||
watch,
|
||||
watchEffect,
|
||||
} from "vue";
|
||||
import { onClickOutside, useResizeObserver, useWindowSize } from "@vueuse/core";
|
||||
import { onClickOutside, useResizeObserver, useScroll, useWindowSize } from "@vueuse/core";
|
||||
import { DropdownTrigger, dropdownPlacement } from "./interface";
|
||||
|
||||
export interface LayDropdownProps {
|
||||
@ -232,6 +229,12 @@ const getContentOffset = (
|
||||
}
|
||||
};
|
||||
|
||||
useResizeObserver(contentRef, () => {
|
||||
if (openState.value) {
|
||||
updateContentStyle()
|
||||
}
|
||||
})
|
||||
|
||||
provide("openState", openState);
|
||||
|
||||
defineExpose({ open, hide, toggle });
|
||||
|
Loading…
Reference in New Issue
Block a user