From 05a7dcfbf596c0b598f701f1f7b6e055caca408a Mon Sep 17 00:00:00 2001 From: morning-star Date: Sun, 9 Jul 2023 07:10:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=20docs/dropdown/detail/o?= =?UTF-8?q?ptions.md=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化 docs/dropdown/detail/options.md 文档 --- docs/dropdown/detail/options.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/dropdown/detail/options.md b/docs/dropdown/detail/options.md index 08096c57..a71307f0 100644 --- a/docs/dropdown/detail/options.md +++ b/docs/dropdown/detail/options.md @@ -266,6 +266,7 @@ click: function(data, othis){ /* return false; */ +} ``` 用法详见:[#示例](#examples) @@ -273,4 +274,4 @@ click: function(data, othis){ - \ No newline at end of file + From de57198ca8a7204aee68f7d572a6d614fce043fd Mon Sep 17 00:00:00 2001 From: sight <1453017105@qq.com> Date: Sun, 9 Jul 2023 10:49:16 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20dropdown=20=E7=BB=84?= =?UTF-8?q?=E5=90=88=E6=94=B6=E7=BC=A9=E8=8F=9C=E5=8D=95=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=8A=98=E5=8F=A0=E6=97=B6=E9=87=8D=E7=BD=AE=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E4=B8=AD=E6=89=80=E6=9C=89=E5=9B=BE=E6=A0=87=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/dropdown.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/dropdown.js b/src/modules/dropdown.js index 247e9bee..6c2d4e3b 100644 --- a/src/modules/dropdown.js +++ b/src/modules/dropdown.js @@ -419,13 +419,14 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){ //设置菜单组展开和收缩状态 thisModule.spread = function(othis){ //菜单组展开和收缩 - var elemIcon = othis.children('.'+ STR_MENU_TITLE).find('.layui-icon'); - if(othis.hasClass(STR_ITEM_UP)){ + var needSpread = othis.hasClass(STR_ITEM_UP); + var elemIcon = othis.children('.'+ STR_MENU_TITLE).find('.layui-icon-' + (needSpread ? 'down' : 'up')); + if(needSpread){ othis.removeClass(STR_ITEM_UP).addClass(STR_ITEM_DOWN); elemIcon.removeClass('layui-icon-down').addClass('layui-icon-up'); } else { othis.removeClass(STR_ITEM_DOWN).addClass(STR_ITEM_UP); - elemIcon.removeClass('layui-icon-up').addClass('layui-icon-down') + elemIcon.removeClass('layui-icon-up').addClass('layui-icon-down'); } };