: dropdown 默认渲染至 body

This commit is contained in:
sight
2022-07-20 20:50:44 +08:00
parent 16f9dd30c8
commit 8a0db60bed
7 changed files with 51 additions and 31 deletions

View File

@@ -72,13 +72,15 @@
border-color: #EEEEEE;
}
.layui-dropdown-content .layui-dropdown{
.layui-dropdown-content .layui-menu li.layui-disabled:hover {
background-color: inherit;
}
// fix style
.layui-dropdown-menu .layui-dropdown{
display: block;
width: -moz-available;
width: -webkit-fill-available;
width: fill-available;
width: 100%;
}
.layui-dropdown-content .layui-menu li.layui-disabled:hover {
background-color: inherit;
}

View File

@@ -73,6 +73,7 @@ const props = withDefaults(defineProps<LayDropdownProps>(), {
mouseLeaveDelay: 150,
focusDelay: 150,
alignPoint: false,
popupContainer: "body",
});
const childrenRefs = new Set<Ref<HTMLElement>>();

View File

@@ -36,6 +36,7 @@ const props = withDefaults(defineProps<LayDropdownSubMenuProps>(), {
:auto-fit-min-width="false"
:contentOffset="contentOffset"
:disabled="disabled"
updateAtScroll
>
<lay-dropdown-menu-item :disabled="disabled">
<template v-if="$slots.prefix" #prefix>

View File

@@ -367,6 +367,15 @@
.layui-this {
background-color: var(--global-primary-color);
}
// fix style
.layui-dropdown {
display: block;
width: -moz-available;
width: -webkit-fill-available;
width: fill-available;
width: 100%;
}
}
.layui-sub-menu-popup-theme {

View File

@@ -34,6 +34,7 @@ const isOpen = computed(() => {
:autoFitMinWidth="false"
:contentOffset="3"
popupContainer="body"
updateAtScroll
class="layui-sub-menu-popup"
>
<li :class="['layui-nav-item']">