From d5baf8d8100afd2884a329243bec051e2f978751 Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 7 Apr 2021 23:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=A4=9A=E7=BA=A7=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/tree.html | 322 ++++++++++++++++++----------------- public/cdn/layui-ul.css | 21 ++- public/static/css/common.css | 142 +++++++-------- 3 files changed, 254 insertions(+), 231 deletions(-) diff --git a/demo/tree.html b/demo/tree.html index cd5ccda..d4adb79 100644 --- a/demo/tree.html +++ b/demo/tree.html @@ -7,179 +7,191 @@ 需要自己写出目录收缩逻辑
-
- - 读书笔记 +
+
+ + 读书笔记 +
+
+
+
+ + 小说 +
+
+ +
+
+
-
- 小说 -
-
- - 技术笔记 -
-
- Mysql -
-
- - PHP -
-
- 扩展 -
-
- 框架 -
-
- +
+
+ + 技术笔记 +
+
+
+
+ + Mysql +
+
+ +
+
+
+
+ + PHP +
+
+
+
+ + 扩展 +
+
+ +
+
+
+
+ + 框架 +
+
+ +
+
+
+
+

       
     
- 动态生成 + 基本组件
- 其实在生成目录时,只需要一个简单地上下级关系和正确的level层级,很容易写出收缩逻辑. -
- 但是如果不愿意写更多的js逻辑,那么你可以生成一个多层级关系的json,然后把js的逻辑复制走,就像下面的代码一样 + 最基本的组件,ul-tree-item-icon的按钮会在执行js后进行相应的移除,缩进样式也许需要执行js
-
- +
+
+
+
+ + 读书笔记 +
+
+ +
+
+ +
- -
-

-      
+    
+
+
+
+ + 读书笔记 +
+
+
+
+ + 小说 +
+
+ +
+
+
+
+ +
+

+    
+ +
+
+
+ + 读书笔记 +
+
+
+
+ +
+ +
+
+
+ + 读书笔记 +
+
+
+
+ + 小说 +
+
+ +
+
+
+
+ +
+
\ No newline at end of file diff --git a/public/cdn/layui-ul.css b/public/cdn/layui-ul.css index 250aa0e..efdcbdc 100644 --- a/public/cdn/layui-ul.css +++ b/public/cdn/layui-ul.css @@ -522,21 +522,28 @@ } .ul-tree-item { - padding : 8px; background-color: #fbfbfb; - position : relative; - border-left : 3px solid transparent; - cursor : pointer; + cursor: pointer; } -.ul-tree-item:hover, -.ul-tree-item.current { +.ul-tree-item-info { + border-left: 3px solid transparent; + padding : 8px 0; + position : relative; +} + + +.ul-tree-item-info.current { background-color: #9cf; border-color : #6699CC; } +.ul-tree-item-info:hover{ + background-color: rgb(190, 222, 255); + border-color : #6699CC; +} .ul-tree-item-title { - margin-left: 15px; + margin-left: 25px; } .ul-tree-item-icon { diff --git a/public/static/css/common.css b/public/static/css/common.css index 395b604..806dc5b 100644 --- a/public/static/css/common.css +++ b/public/static/css/common.css @@ -1,114 +1,118 @@ - - -.left-bottom-options{ - position: fixed; - left: 20px; - bottom: 60px; - background: rgba(0,0,0,0.4); - color: #fff; - font-size: 35px; - padding: 3px 5px; +.left-bottom-options { + position : fixed; + left : 20px; + bottom : 60px; + background: rgba(0, 0, 0, 0.4); + color : #fff; + font-size : 35px; + padding : 3px 5px; } .main-container { - margin-top: 10px; + margin-top: 10px; } .layui-table img { - max-width: 60px; - max-height: 60px; + max-width : 60px; + max-height: 60px; } -.table-card-box{ - margin-top: 15px; - background-color: #eee; - padding: 15px 5px; +.table-card-box { + margin-top : 15px; + background-color: #eee; + padding : 15px 5px; } -.table-card-item{ - - margin-top: 5px; - display: flex; - justify-content: flex-start; - align-items: flex-start; +.table-card-item { + + margin-top : 5px; + display : flex; + justify-content: flex-start; + align-items : flex-start; } -.table-card-item img{ - max-width: 60px; - max-height: 60px; +.table-card-item img { + max-width : 60px; + max-height: 60px; } -.table-card-item .item-title{ - padding: 5px; - font-size: 16px; - width: 20%; +.table-card-item .item-title { + padding : 5px; + font-size: 16px; + width : 20%; } -.table-card-item .item-value{ - padding: 5px; - margin: 5px; - background-color: #fff; - min-width: 80%; - white-space: normal; - word-break: break-all; + +.table-card-item .item-value { + padding : 5px; + margin : 5px; + background-color: #fff; + min-width : 80%; + white-space : normal; + word-break : break-all; } -.layui-form-radio{ + +.layui-form-radio { white-space: nowrap; } -.quick-input-item{ - width: 120px; +.quick-input-item { + width : 120px; margin: 3px 0; } -.quick-input-item.sm-quick-input-item .layui-btn{ - line-height: 24px; - height: 24px; - font-size: 12px; - padding: 0 12px; - -} - -.quick-input-item.sm-quick-input-item .layui-input{ +.quick-input-item.sm-quick-input-item .layui-btn { line-height: 24px; - height: 24px; + height : 24px; + font-size : 12px; + padding : 0 12px; + } -.ul-flex{ +.quick-input-item.sm-quick-input-item .layui-input { + line-height: 24px; + height : 24px; +} + +.ul-flex { display: flex; } -.ql-snow .ql-editor pre.ql-syntax{ +.ql-snow .ql-editor pre.ql-syntax { line-height: 1.4; } -@media screen and (max-width: 768px){ - .layui-body{ - left: 0; +@media screen and (max-width: 768px) { + .layui-body { + left: 0; } - .layui-layout-admin .layui-footer{ - left: 0; + .layui-layout-admin .layui-footer { + left: 0; } - .layui-layout-admin .layui-logo{ - width: 115px; + .layui-layout-admin .layui-logo { + width: 115px; } - .layui-layout-admin .layui-side{ - width: 100%; - overflow-x: hidden; - height: 100%; - position: unset; + .layui-layout-admin .layui-side { + width : 100%; + overflow-x: hidden; + height : 100%; + position : unset; } - .layui-layer-content .layui-hide-xs{ - display: unset !important; + .layui-layer-content .layui-hide-xs { + display: unset !important; } - .layui-nav-tree{ - width: 100%; - height: 100%; + .layui-nav-tree { + width : 100%; + height: 100%; } +} + +.demo-js-src { + display: none; } \ No newline at end of file