Skip to content

Commit 30d7d6a

Browse files
恢复添加标签导航右侧关闭下拉菜单,同时还支持在标签上右键关闭
1 parent 131d5f8 commit 30d7d6a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/components/main/components/tags-nav/tags-nav.less

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
left: 0px;
4343
}
4444
&.right-btn{
45-
right: 0px;
45+
right: 32px;
4646
border-right: 1px solid #F0F0F0;
4747
}
4848
}
4949
.scroll-outer{
5050
position: absolute;
5151
left: 28px;
52-
right: 28px;
52+
right: 61px;
5353
top: 0;
5454
bottom: 0;
5555
box-shadow: 0px 0 3px 2px rgba(100,100,100,.1) inset;

src/components/main/components/tags-nav/tags-nav.vue

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
<template>
22
<div class="tags-nav">
3+
<div class="close-con">
4+
<Dropdown transfer @on-click="handleTagsOption" style="margin-top:7px;">
5+
<Button size="small" type="text">
6+
<Icon :size="18" type="ios-close-circle-outline" />
7+
</Button>
8+
<DropdownMenu slot="list">
9+
<DropdownItem name="close-all">关闭所有</DropdownItem>
10+
<DropdownItem name="close-others">关闭其他</DropdownItem>
11+
</DropdownMenu>
12+
</Dropdown>
13+
</div>
314
<ul v-show="visible" :style="{left: contextMenuLeft + 'px', top: contextMenuTop + 'px'}" class="contextmenu">
415
<li v-for="(item, key) of menuList" @click="handleTagsOption(key)" :key="key">{{item}}</li>
516
</ul>
@@ -95,11 +106,11 @@ export default {
95106
}
96107
},
97108
handleTagsOption (type) {
98-
if (type === 'all') {
109+
if (type.includes('all')) {
99110
// 关闭所有,除了home
100111
let res = this.list.filter(item => item.name === 'home')
101112
this.$emit('on-close', res, 'all')
102-
} else if (type === 'others') {
113+
} else if (type.includes('others')) {
103114
// 关闭除当前页和home页的其他页
104115
let res = this.list.filter(item => routeEqual(this.currentRouteObj, item) || item.name === 'home')
105116
this.$emit('on-close', res, 'others', this.currentRouteObj)

0 commit comments

Comments
 (0)