From 529f3bf92d36c9b88491c8e650db977f01240dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Wed, 9 Sep 2020 14:38:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5=20dropdown=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=A4=BE=E5=8C=BA=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- component/pear/css/pear-module/dropdown.css | 7 +++++++ component/pear/css/pear.css | 1 + component/pear/module/dropdown.js | 7 +++++++ component/pear/pear.all.js | 4 +++- component/pear/pear.js | 3 ++- 6 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 component/pear/css/pear-module/dropdown.css create mode 100644 component/pear/module/dropdown.js diff --git a/README.md b/README.md index 0c95498..80c2471 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 开 箱 即 用 的 前 后 端 解 决 方 案 - [预 览](http://layui.pearadmin.com) | [官 网](http://www.pearadmin.com/) | [群聊](https://jq.qq.com/?_wv=1027&k=5OdSmve) | [社区](http://fly.pearadmin.com/posts) + [预 览](http://layui.pearadmin.com) | [官 网](http://www.pearadmin.com/) | [群聊](https://jq.qq.com/?_wv=1027&k=5OdSmve) | [社区](http://forum.pearadmin.com/) diff --git a/component/pear/css/pear-module/dropdown.css b/component/pear/css/pear-module/dropdown.css new file mode 100644 index 0000000..f5a4385 --- /dev/null +++ b/component/pear/css/pear-module/dropdown.css @@ -0,0 +1,7 @@ +/** + * layui_dropdown + * v2.3.2 + * by Microanswer + * http://layuidropdown.microanswer.cn/ + **/ +html #layuicss-dropdown_css{display:none;position:absolute;width:1989px}.dropdown-root{position:fixed;outline:0;overflow:hidden}.dropdown-pointer{width:0;height:0;position:absolute;display:block;overflow:hidden;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAgBAMAAABQs2O3AAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABVQTFRFAAAAgICAgICAgICAhISE8PDw////jUnEegAAAAd0Uk5TAB/2/////74r3wgAAACOSURBVHicfcztDYAgDEVR2MCwgXEDwwbGDYwbyP4jyJfYlvbdvzc5zrH8ti8OFeKxou+384JEiPeDiAykhIgMpASICiCiAoDogE10wCQGYBEDMAgC6AQBVIIBGsEAhRDATAhgIiZAEhMgCAXghAIwQgUooQKEMICfMIBBmMBHmEAnANAIADQCAYVwCCjEC5fhzAE36RUGAAAAAElFTkSuQmCC) bottom center no-repeat;background-size:100% 50%;-webkit-transform-origin:center center;-moz-transform-origin:center center;-ms-transform-origin:center center;-o-transform-origin:center center;transform-origin:center center}.dropdown-pointer.bottom{-webkit-transform:rotate(-180deg);-moz-transform:rotate(-180deg);-ms-transform:rotate(-180deg);-o-transform:rotate(-180deg);transform:rotate(-180deg)}.dropdown-root .dropdown-content{background-color:#fff;border-radius:3px;box-shadow:1px 1px 5px #979797;overflow-x:auto;overflow-y:hidden}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-thead{display:table-header-group}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tbody{display:table-row-group}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr{display:table-row}.dropdown-root .dropdown-content .dropdown-content-table,.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-td,.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-th{display:table-cell;border:unset;text-align:unset;font-weight:400;min-height:unset;font-size:12px;line-height:12px;padding-top:0;padding-bottom:0}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-th{font-weight:700}.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr,.dropdown-root .dropdown-content .dropdown-content-table .dropdown-content-tr:hover{background-color:unset}.dropdown-root .dropdown-content .dropdown-menu-wrap{border-right:1px solid transparent;overflow-y:auto;overflow-x:hidden}.dropdown-root .dropdown-content .dropdown-menu-fixed-head{border-right:1px solid transparent;overflow:hidden}.dropdown-root .dropdown-content .dropdown-menu-fixed-head .menu-fixed-head{margin:6px 14px 2px;color:#a8a8a8;font-size:12px}.dropdown-root .dropdown-content .dropdown-menu-fixed-head.menu-splitor,.dropdown-root .dropdown-content .dropdown-menu-wrap.menu-splitor{border-right:1px solid #D9D9D9}.dropdown-root .dropdown-content .dropdown-menu-wrap.overflowauto{overflow-y:auto;overflow-x:hidden}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu{padding:0;margin:0}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap{list-style:none;outline:0}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap:first-child{margin-top:10px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap.nomargin{margin-top:0!important}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap:last-child{margin-bottom:10px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header{margin-top:6px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header.withLine{margin-left:0;margin-bottom:0;margin-right:0}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header,.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-header legend{font-size:12px!important;line-height:15px!important;padding:0 14px!important;color:#a8a8a8}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item{line-height:36px}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item a{display:block;color:#333;padding:0 20px;min-width:40px;text-indent:0;font-size:14px;white-space:nowrap}.dropdown-root .dropdown-content .dropdown-menu-wrap .dropdown-menu .menu-item-wrap .menu-item a:hover{background-color:#D9D9D9} \ No newline at end of file diff --git a/component/pear/css/pear.css b/component/pear/css/pear.css index dc225e2..7694da5 100644 --- a/component/pear/css/pear.css +++ b/component/pear/css/pear.css @@ -6,6 +6,7 @@ @import url("pear-module/dtree/dtree.css"); @import url("pear-module/iconPicker.css"); @import url("pear-module/treetable.css"); +@import url("pear-module/dropdown.css"); @import url("pear-module/topBar.css"); @import url("pear-module/select.css"); @import url("pear-module/layout.css"); diff --git a/component/pear/module/dropdown.js b/component/pear/module/dropdown.js new file mode 100644 index 0000000..43676f5 --- /dev/null +++ b/component/pear/module/dropdown.js @@ -0,0 +1,7 @@ +/** + * layui_dropdown + * v2.3.2 + * by Microanswer + * http://layuidropdown.microanswer.cn/ + **/ +layui.define(["jquery","laytpl"],function(i){var s=layui.jquery||layui.$,r=layui.laytpl,e="a",d={},c="1",u="2",m="3";function f(i){if(!i)throw new Error("菜单条目内必须填写内容。");if("hr"===i)return"hr";if(0!==i.indexOf("{"))throw new Error("除了分割线hr,别的菜单条目都必须保证是合格的Javascript对象或json对象。");return new Function("return "+i)()}function a(i){if(i&&0