生成侧边主菜单:
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; margin-left: 16px; } .pear-nav-tree .layui-nav-child dd a span { #margin-left: 26px !important; }
参考:
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END