Skip to content

Commit 12c2fc4

Browse files
committed
Merge branch 'dev'
2 parents 494429e + 578f03f commit 12c2fc4

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

packages/devui-vue/devui/dropdown/src/dropdown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default defineComponent({
3333
props,
3434
emit,
3535
});
36-
useDropdown(id, visible, isOpen, origin, dropdownRef, currentPosition, emit);
36+
useDropdown(id, visible, isOpen, origin, dropdownRef, emit);
3737
const { overlayModelValue, overlayShowValue, styles, classes, handlePositionChange } = useOverlayProps(props, currentPosition, isOpen);
3838

3939
watch(overlayShowValue, (overlayShowValueVal) => {

packages/devui-vue/devui/dropdown/src/use-dropdown.ts

-15
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,8 @@ export function useDropdown(
112112
isOpen: Ref<boolean>,
113113
origin: Ref<HTMLElement | undefined>,
114114
dropdownRef: Ref<HTMLElement | undefined>,
115-
popDirection: Ref<string>,
116115
emit: EmitEvent
117116
): void {
118-
const calcPopDirection = (dropdownEl: HTMLElement) => {
119-
const elementHeight = dropdownEl.offsetHeight;
120-
const bottomDistance = window.innerHeight - (origin.value as HTMLElement).getBoundingClientRect().bottom;
121-
const isBottomEnough = bottomDistance >= elementHeight;
122-
if (!isBottomEnough) {
123-
popDirection.value = 'top';
124-
} else {
125-
popDirection.value = 'bottom';
126-
}
127-
};
128-
129117
watch(
130118
visible,
131119
(newVal, oldVal) => {
@@ -153,9 +141,6 @@ export function useDropdown(
153141
}
154142
}
155143
}
156-
if (dropdownEl) {
157-
calcPopDirection(dropdownEl);
158-
}
159144
});
160145
onMounted(() => {
161146
dropdownMap.set(id, { toggleEl: origin.value });

packages/devui-vue/devui/editable-select/src/components/dropdown/dropdown.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default defineComponent({
3232

3333
// 渲染options
3434
const renderOption = () => {
35-
if (props.options.length === 0) {
35+
if (props.options.length === 0 && !select.loading.value) {
3636
return <li class={ns.em('item', 'no-data-tip')}>{slots.noResultItem ? slots.noResultItem() : emptyText.value}</li>;
3737
}
3838

packages/devui-vue/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-devui",
3-
"version": "1.6.4-select.0",
3+
"version": "1.6.5",
44
"license": "MIT",
55
"description": "DevUI components based on Vite and Vue3",
66
"keywords": [

0 commit comments

Comments
 (0)