Loading
0

pear admin layui 小技巧

生成侧边主菜单:

var sideMenu = menu.render({
	elem: 'sideMenu',
	async: true,
	theme: "dark-theme",
	height: '100%',
	control: false, 
	defaultMenu: 0,
	accordion: true,
	url: "admin/data/menu.json",
	parseData: false,
	done: function() {
		layer.msg("加载完成")
	}
});

直接打开标签页:

var id="joycode";
var title="编程小战";
var url="https://www.joycode.com.cn";
layui.admin.jump(id,title,url);

子菜单图示不显示:

找到pear/component/pear/css/module/menu.css文件,修改下面样式的display属性,注释margin-left属性:

.pear-nav-tree .layui-nav-child dd a i {
	display: inline-block;
}

.pear-nav-tree .layui-nav-child dd a span {
	#margin-left: 26px !important;
}

参考:

最后编辑于:2022/9/17作者: joycode

评论已关闭