菜单默认选中项
parent
87d06e52d8
commit
a2dd4580e2
|
|
@ -5,7 +5,7 @@
|
|||
"icon": "layui-icon layui-icon-console",
|
||||
"href": "",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"id": 0,
|
||||
"title": "控制后台",
|
||||
"icon": "layui-icon layui-icon-console",
|
||||
"type": 1,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
layui.define(['table', 'jquery', 'element', 'form', 'pearAuth', 'pearTab', 'pearMenu', 'pearNotice', 'pearFrame'],
|
||||
function(exports) {
|
||||
"use strict";
|
||||
|
|
@ -57,6 +56,7 @@ layui.define(['table', 'jquery', 'element', 'form', 'pearAuth', 'pearTab', 'pear
|
|||
change: option.change
|
||||
})
|
||||
|
||||
sideMenu.selectItem(option.select);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ layui.define(['table', 'jquery', 'element', 'form', 'pearAuth', 'pearTab', 'pear
|
|||
index: 0,
|
||||
tabMax: 20,
|
||||
data: [{
|
||||
id: '11',
|
||||
id: '0',
|
||||
url: option.index,
|
||||
title: '首页',
|
||||
close: false
|
||||
|
|
@ -219,11 +219,12 @@ layui.define(['table', 'jquery', 'element', 'form', 'pearAuth', 'pearTab', 'pear
|
|||
'.pearone-color .color-content li.layui-this:after, .pearone-color .color-content li:hover:after {border: ' +
|
||||
color + ' 2px solid!important;}';
|
||||
|
||||
style +='.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:'+color+'!important}';
|
||||
|
||||
style +='.pear-social-entrance {background-color:'+color+'!important}';
|
||||
|
||||
style +='.pear-admin .pe-collaspe {background-color:'+color+'!important}';
|
||||
style += '.layui-nav .layui-nav-child dd.layui-this a, .layui-nav-child dd.layui-this{background-color:' + color +
|
||||
'!important}';
|
||||
|
||||
style += '.pear-social-entrance {background-color:' + color + '!important}';
|
||||
|
||||
style += '.pear-admin .pe-collaspe {background-color:' + color + '!important}';
|
||||
|
||||
// 自 定 义 滚 动 条 样 式
|
||||
|
||||
|
|
@ -489,8 +490,8 @@ layui.define(['table', 'jquery', 'element', 'form', 'pearAuth', 'pearTab', 'pear
|
|||
|
||||
var color = localStorage.getItem("theme-color");
|
||||
|
||||
if (color!="null") {
|
||||
|
||||
if (color != "null") {
|
||||
|
||||
$(".select-color-item").removeClass("layui-icon")
|
||||
.removeClass("layui-icon-ok");
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
parseData: opt.parseData,
|
||||
url: opt.url,
|
||||
defaultOpen: opt.defaultOpen,
|
||||
defaultSelect: opt.defaultSelect,
|
||||
control: opt.control,
|
||||
defaultMenu: opt.defaultMenu,
|
||||
accordion: opt.accordion,
|
||||
|
|
@ -54,8 +55,6 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
|
||||
downShow(option);
|
||||
|
||||
|
||||
|
||||
option.done();
|
||||
return new pearMenu(option);
|
||||
}
|
||||
|
|
@ -230,7 +229,7 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
|
||||
var content = '<li class="layui-nav-item" >';
|
||||
|
||||
if (i == option.defaultOpen && option.defaultOpen != false) {
|
||||
if (i == option.defaultOpen) {
|
||||
content = '<li class="layui-nav-item layui-nav-itemed" >';
|
||||
}
|
||||
|
||||
|
|
@ -251,6 +250,7 @@ layui.define(['table', 'jquery', 'element'], function(exports) {
|
|||
'" ' + target + '><i class="' + item.icon + '"></i><span>' + item.title +
|
||||
'</span></a>';
|
||||
} else if (item.type == 1) {
|
||||
|
||||
// 创 建 菜 单 结 构
|
||||
content += '<a class="' + calss + '" menu-type="' + item.type + '" menu-url="' + item.href + '" menu-id="' +
|
||||
item.id +
|
||||
|
|
|
|||
|
|
@ -84,7 +84,8 @@
|
|||
theme: "dark-theme", // 默 认 主 题 样 式 dark-theme 默认主题 light-theme 亮主题
|
||||
index: 'view/console/console1.html', // 默 认 加 载 主 页
|
||||
data: 'admin/data/menu.json', // 菜 单 数 据 加 载 地 址
|
||||
notice: 'admin/data/notice.json',
|
||||
select: '0', // 默 认 选 中 菜 单 项
|
||||
notice: 'admin/data/notice.json', // 消 息 列 表 数 据
|
||||
auth: 'admin/data/permission.json' // 前端权限限制,false 关闭该功能
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue