|
|
@ -261,13 +261,15 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
|
|
|
|
|
|
|
|
|
|
|
|
//触发菜单列表事件
|
|
|
|
//触发菜单列表事件
|
|
|
|
that.elemView.find('.layui-menu li').on('click', function(e){
|
|
|
|
that.elemView.find('.layui-menu li').on('click', function(e){
|
|
|
|
var othis = $(this)
|
|
|
|
var othis = $(this);
|
|
|
|
,data = othis.data('item') || {}
|
|
|
|
var data = othis.data('item') || {};
|
|
|
|
,isChild = data.child && data.child.length > 0;
|
|
|
|
var isChild = data.child && data.child.length > 0;
|
|
|
|
|
|
|
|
var isClickAllScope = options.clickScope === 'all'; // 是否所有父子菜单均触发点击事件
|
|
|
|
|
|
|
|
|
|
|
|
if(!isChild && data.type !== '-'){
|
|
|
|
if((!isChild || isClickAllScope) && data.type !== '-'){
|
|
|
|
that.remove();
|
|
|
|
isChild || that.remove();
|
|
|
|
typeof options.click === 'function' && options.click(data, othis);
|
|
|
|
typeof options.click === 'function' && options.click(data, othis);
|
|
|
|
|
|
|
|
layui.stope(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|