From 3b781390feec3a6dd060ead4933d1fd7b0edecc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Thu, 7 Dec 2023 09:26:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20`util.on()`=20=E5=9C=A8?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E6=83=85=E5=86=B5=E4=B8=8B=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=B3=95=E9=97=AE=E9=A2=98=20Closes:=20https://gitee.com/layui?= =?UTF-8?q?/layui/issues/I8M528?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/util.js b/src/modules/util.js index ed5c88ab..cc628ee2 100644 --- a/src/modules/util.js +++ b/src/modules/util.js @@ -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]);