feat: 点击鼠标滚轮键关闭标签页

This commit is contained in:
tianyiw 2025-03-26 09:36:09 +08:00 committed by GitHub
parent a9ee9ebcf9
commit c97c0dada2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -514,6 +514,13 @@ function tagOnClick(item) {
emitter.emit("tagOnClick", item);
}
/** 点击鼠标滚轮键关闭标签页 */
function tagOnMousedown(index: Number, item: any, e: MouseEvent) {
if (e.button == 1 && index !== 0) {
deleteMenu(item);
}
}
onClickOutside(contextmenuRef, closeMenu, {
detectIframe: true
});
@ -586,6 +593,7 @@ onBeforeUnmount(() => {
@mouseenter.prevent="onMouseenter(index)"
@mouseleave.prevent="onMouseleave(index)"
@click="tagOnClick(item)"
@mousedown="tagOnMousedown(index, item, $event)"
>
<template v-if="showModel !== 'chrome'">
<span