From 5501cc8dc1f7c4e3d281479f523354683248f682 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: Fri, 4 Jun 2021 11:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20collaspe=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=94=AF=E6=8C=81=E9=BB=98=E8=AE=A4=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=94=B6=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/module/admin.js | 9 +++++++++ config/pear.config.json | 1 + config/pear.config.yml | 2 ++ 3 files changed, 12 insertions(+) diff --git a/component/pear/module/admin.js b/component/pear/module/admin.js index b9c937e..67365d5 100644 --- a/component/pear/module/admin.js +++ b/component/pear/module/admin.js @@ -195,6 +195,14 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm $(".loader-main").fadeOut(200); }, param.other.keepLoad) } + + this.collaspe = function(param) { + if(param.menu.collaspe) { + if ($(window).width() >= 768) { + collaspe() + } + } + } this.themeRender = function(option) { if (option.theme.allowCustom === false) { @@ -427,6 +435,7 @@ layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'm pearAdmin.bodyRender(param); pearAdmin.themeRender(param); pearAdmin.keepLoad(param); + pearAdmin.collaspe(param) if (param.header.message != false) { pearAdmin.messageRender(param); } diff --git a/config/pear.config.json b/config/pear.config.json index 2ce26b6..64c420e 100644 --- a/config/pear.config.json +++ b/config/pear.config.json @@ -5,6 +5,7 @@ }, "menu": { "data": "admin/data/menu.json", + "collaspe": true, "accordion": true, "method": "GET", "control": false, diff --git a/config/pear.config.yml b/config/pear.config.yml index 5f24496..d45f39b 100644 --- a/config/pear.config.yml +++ b/config/pear.config.yml @@ -13,6 +13,8 @@ menu: method: "GET" ## 是否同时只打开一个菜单目录 accordion: true + ## 侧边默认折叠状态 + collaspe: false ## 是否开启多系统菜单模式 control: false ## 默认选中的菜单项