feat(projects): close tab by mouse wheel button click
This commit is contained in:
parent
e3bd397248
commit
d3849baaff
@ -53,10 +53,23 @@ const bindProps = computed(() => {
|
|||||||
function handleClose() {
|
function handleClose() {
|
||||||
emit('close');
|
emit('close');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleMouseup(e: MouseEvent) {
|
||||||
|
// close tab by mouse wheel button click
|
||||||
|
if (e.button === 1) {
|
||||||
|
handleClose();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<component :is="activeTabComponent.component" :class="activeTabComponent.class" :style="cssVars" v-bind="bindProps">
|
<component
|
||||||
|
:is="activeTabComponent.component"
|
||||||
|
:class="activeTabComponent.class"
|
||||||
|
:style="cssVars"
|
||||||
|
v-bind="bindProps"
|
||||||
|
@mouseup="handleMouseup"
|
||||||
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<slot name="prefix"></slot>
|
<slot name="prefix"></slot>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user