From eba7a748fd444718ad9c44972cbfeaf447550114 Mon Sep 17 00:00:00 2001 From: ChinaMoli Date: Sat, 25 May 2024 13:39:28 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E9=80=89=E9=A1=B9=E5=8D=A1=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=80=9A=E8=BF=87=E9=BC=A0=E6=A0=87=E6=BB=9A=E8=BD=AE?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/pear/module/tabPage.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/component/pear/module/tabPage.js b/component/pear/module/tabPage.js index 44cb83c..ed0eeaf 100644 --- a/component/pear/module/tabPage.js +++ b/component/pear/module/tabPage.js @@ -559,10 +559,19 @@ layui.define(['jquery', 'element', 'dropdown'], function (exports) { } function closeEvent(option) { - $(".layui-tab[lay-filter='" + option.elem + "']").on("click", ".layui-tab-close", function () { - var layid = $(this).parent().attr("lay-id"); - tabDelete(option.elem, layid, option.closeEvent, option); - }) + $(".layui-tab[lay-filter='" + option.elem + "']") + .on("click", ".layui-tab-close", function () { + var layid = $(this).parent().attr("lay-id"); + tabDelete(option.elem, layid, option.closeEvent, option); + }) + .on("mousedown", ".layui-tab-title li", function (e) { + if ( + e.buttons === 4 // 滚轮点击事件 + && $(this).find("span").is(".able-close") + ) { + tabDelete(option.elem, $(this).attr("lay-id"), option.closeEvent, option); + } + }); } function menuEvent(option, index) { -- Gitee