优化 dropdown 的 `click` 回调函数,当其返回 `return false` 时,点击菜单可不关闭面板

pull/1203/head
贤心 2023-02-16 09:51:40 +08:00
parent 78609d9745
commit 3627677d7f
1 changed files with 2 additions and 2 deletions

View File

@ -275,8 +275,8 @@ layui.define(['jquery', 'laytpl', 'lay'], function(exports){
var isClickAllScope = options.clickScope === 'all'; // 是否所有父子菜单均触发点击事件
if((!isChild || isClickAllScope) && data.type !== '-'){
isChild || that.remove();
typeof options.click === 'function' && options.click(data, othis);
var ret = typeof options.click === 'function' && options.click(data, othis);
ret === false || (isChild || that.remove());
layui.stope(e);
}
});