优化 util.on() 在特殊情况下的用法问题

Closes: https://gitee.com/layui/layui/issues/I8M528
This commit is contained in:
贤心 2023-12-07 09:26:38 +08:00
parent a03b4d6c24
commit 3b781390fe

View File

@ -427,7 +427,7 @@ layui.define('jquery', function(exports){
var callbacks = dataCache.callbacks;
// 根据 attr 记录事件集合
events = $.extend(true, dataCache.events, events) || {};
events = dataCache.events[attr] = $.extend(true, dataCache.events[attr], events);
// 清除事件委托,避免重复绑定
elem.off(options.trigger, attrSelector, callbacks[attr]);