From 361d84e7fcf7ea5a5a27278a81a7271b9e910044 Mon Sep 17 00:00:00 2001 From: wuzhao Date: Tue, 14 Sep 2021 17:50:06 +0800 Subject: [PATCH] =?UTF-8?q?add:=20uDropdown=20=E5=A4=9A=E9=A1=B9=E7=AD=9B?= =?UTF-8?q?=E9=80=89,=E6=94=AF=E6=8C=81=E5=A4=9A=E4=B8=AA=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E9=AB=98=E4=BA=AE,.gitignore=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9Eyarn.lock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + uview-ui/components/u-dropdown/u-dropdown.vue | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 999c4c54..f02e7fb4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /node_modules/* /.idea/* deploy.sh +yarn.lock diff --git a/uview-ui/components/u-dropdown/u-dropdown.vue b/uview-ui/components/u-dropdown/u-dropdown.vue index a62e469a..c3abe6c2 100644 --- a/uview-ui/components/u-dropdown/u-dropdown.vue +++ b/uview-ui/components/u-dropdown/u-dropdown.vue @@ -8,13 +8,13 @@ {{item.title}} - + @@ -123,8 +123,8 @@ zIndex: -1, opacity: 0 }, - // 让某个菜单保持高亮的状态 - highlightIndex: 99999, + // 让某个菜单保持高亮的状态 支持多个菜单高亮 + highlightIndex: [9999], contentHeight: 0 } }, @@ -173,7 +173,7 @@ // 打开下拉菜单 open(index) { // 重置高亮索引,否则会造成多个菜单同时高亮 - // this.highlightIndex = 9999; + // this.highlightIndex = [9999]; // 展开时,设置下拉内容的样式 this.contentStyle = { zIndex: 11, @@ -208,7 +208,7 @@ }, // 外部手动设置某个菜单高亮 highlight(index = undefined) { - this.highlightIndex = index !== undefined ? index : 99999; + this.highlightIndex = index !== undefined ? index : [9999]; }, // 获取下拉菜单内容的高度 getContentHeight() {