mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-03-30 03:21:48 +00:00
Merge pull request #189 from DevDengChao/feat/close-tab-on-mouse-mid-click
feat: close tab on mouse mid-button click
This commit is contained in:
@@ -255,6 +255,15 @@ const canShowIcon = (item: RouteLocationNormalizedLoaded) => {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closeTabOnMouseMidClick = (e: MouseEvent, item) => {
|
||||||
|
// 中键:button === 1
|
||||||
|
if (e.button === 1) {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
closeSelectedTag(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
initTags()
|
initTags()
|
||||||
addTags()
|
addTags()
|
||||||
@@ -293,6 +302,7 @@ watch(
|
|||||||
v-for="item in visitedViews"
|
v-for="item in visitedViews"
|
||||||
:key="item.fullPath"
|
:key="item.fullPath"
|
||||||
:ref="itemRefs.set"
|
:ref="itemRefs.set"
|
||||||
|
@auxclick="closeTabOnMouseMidClick($event, item)"
|
||||||
:class="[
|
:class="[
|
||||||
`${prefixCls}__item`,
|
`${prefixCls}__item`,
|
||||||
tagsViewImmerse ? `${prefixCls}__item--immerse` : '',
|
tagsViewImmerse ? `${prefixCls}__item--immerse` : '',
|
||||||
|
|||||||
Reference in New Issue
Block a user