diff --git a/docs/dropdown/detail/options.md b/docs/dropdown/detail/options.md index 5a88c7b5..27ac59f1 100644 --- a/docs/dropdown/detail/options.md +++ b/docs/dropdown/detail/options.md @@ -288,10 +288,11 @@ ready: function(elemPanel, elem){ ``` -click: function(data, othis){ +click: function(data, othis, event){ console.log(data); // 当前所点击的菜单项对应的数据 console.log(othis); // 当前所点击的菜单项元素对象 console.log(this.elem); // 当前组件绑定的目标元素对象,批量绑定中常用 + console.log(event); // 事件对象 2.9.18+ // 若返回 false,则点击选项可不关闭面板 --- 2.8+ /* diff --git a/src/modules/dropdown.js b/src/modules/dropdown.js index f861d3a0..411e78d9 100644 --- a/src/modules/dropdown.js +++ b/src/modules/dropdown.js @@ -340,7 +340,7 @@ layui.define(['jquery', 'laytpl', 'lay', 'util'], function(exports){ // 普通菜单项点击后的回调及关闭面板 if((!isChild || isClickAllScope) && data.type !== '-'){ var ret = typeof options.click === 'function' - ? options.click(data, othis) + ? options.click(data, othis, e) : null; ret === false || (isChild || that.remove());