From 7ed837fe7d195396fb82172fc876c385e5154f6f Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Sun, 3 Jul 2022 00:55:13 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(dropdown):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E5=88=B0=20body?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/component/dropdown/index.less | 10 +- .../src/component/dropdown/index.vue | 206 +++++++++++++----- .../src/component/dropdown/interface.ts | 22 ++ 3 files changed, 179 insertions(+), 59 deletions(-) diff --git a/package/component/src/component/dropdown/index.less b/package/component/src/component/dropdown/index.less index 68dfa6b9..8e6b1c84 100644 --- a/package/component/src/component/dropdown/index.less +++ b/package/component/src/component/dropdown/index.less @@ -3,8 +3,8 @@ display: inline-block; } +.layui-dropdown-content, .layui-dropdown dl { - display: none; position: absolute; z-index: 899; background-color: #fff; @@ -14,6 +14,7 @@ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1); } +.layui-dropdown-content > .layui-dropdown-menu, .layui-dropdown dl > .layui-dropdown-menu { border-radius: var(--global-border-radius); } @@ -22,16 +23,20 @@ display: block; } +.layui-dropdown-content .layui-menu, .layui-dropdown .layui-menu { position: relative; background-color: #fff; } +.layui-dropdown-content .layui-menu li, +.layui-dropdown-content .layui-menu-body-title a, .layui-dropdown .layui-menu li, .layui-dropdown .layui-menu-body-title a { padding: 5px 15px; } +.layui-dropdown-content .layui-menu li, .layui-dropdown .layui-menu li { position: relative; display: flex; @@ -42,10 +47,12 @@ cursor: pointer; } +.layui-dropdown-content .layui-menu li:hover, .layui-dropdown .layui-menu li:hover { background-color: var(--global-neutral-color-2); } +.layui-dropdown-content .layui-menu-body-title, .layui-dropdown .layui-menu-body-title { white-space: nowrap; overflow: hidden; @@ -59,6 +66,7 @@ margin-left: 15px; } +.layui-dropdown-content .layui-line-horizontal, .layui-dropdown .layui-line-horizontal{ margin: 0px; border-color: #EEEEEE; diff --git a/package/component/src/component/dropdown/index.vue b/package/component/src/component/dropdown/index.vue index 3a947ef0..dbc86b15 100644 --- a/package/component/src/component/dropdown/index.vue +++ b/package/component/src/component/dropdown/index.vue @@ -6,7 +6,7 @@ export default {