Skip to content

Commit 8165cbd

Browse files
committed
修复关闭其他标签没有滑到可视区域的bug
1 parent 8f48604 commit 8165cbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export default {
116116
let res = this.list.filter(item => routeEqual(this.currentRouteObj, item) || item.name === this.$config.homeName)
117117
this.$emit('on-close', res, 'others', this.currentRouteObj)
118118
setTimeout(() => {
119-
this.getTagElementByName(this.currentRouteObj.name)
119+
this.getTagElementByRoute(this.currentRouteObj)
120120
}, 100)
121121
}
122122
},
@@ -160,7 +160,7 @@ export default {
160160
this.tagBodyLeft = -(tag.offsetLeft - (outerWidth - this.outerPadding - tag.offsetWidth))
161161
}
162162
},
163-
getTagElementByName (route) {
163+
getTagElementByRoute (route) {
164164
this.$nextTick(() => {
165165
this.refsTag = this.$refs.tagsPageOpened
166166
this.refsTag.forEach((item, index) => {
@@ -186,7 +186,7 @@ export default {
186186
},
187187
watch: {
188188
'$route' (to) {
189-
this.getTagElementByName(to)
189+
this.getTagElementByRoute(to)
190190
},
191191
visible (value) {
192192
if (value) {
@@ -198,7 +198,7 @@ export default {
198198
},
199199
mounted () {
200200
setTimeout(() => {
201-
this.getTagElementByName(this.$route)
201+
this.getTagElementByRoute(this.$route)
202202
}, 200)
203203
}
204204
}

0 commit comments

Comments
 (0)