Skip to content

Commit

Permalink
修复关闭其他标签没有滑到可视区域的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lison16 committed Jan 4, 2019
1 parent 8f48604 commit 8165cbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/main/components/tags-nav/tags-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default {
let res = this.list.filter(item => routeEqual(this.currentRouteObj, item) || item.name === this.$config.homeName)
this.$emit('on-close', res, 'others', this.currentRouteObj)
setTimeout(() => {
this.getTagElementByName(this.currentRouteObj.name)
this.getTagElementByRoute(this.currentRouteObj)
}, 100)
}
},
Expand Down Expand Up @@ -160,7 +160,7 @@ export default {
this.tagBodyLeft = -(tag.offsetLeft - (outerWidth - this.outerPadding - tag.offsetWidth))
}
},
getTagElementByName (route) {
getTagElementByRoute (route) {
this.$nextTick(() => {
this.refsTag = this.$refs.tagsPageOpened
this.refsTag.forEach((item, index) => {
Expand All @@ -186,7 +186,7 @@ export default {
},
watch: {
'$route' (to) {
this.getTagElementByName(to)
this.getTagElementByRoute(to)
},
visible (value) {
if (value) {
Expand All @@ -198,7 +198,7 @@ export default {
},
mounted () {
setTimeout(() => {
this.getTagElementByName(this.$route)
this.getTagElementByRoute(this.$route)
}, 200)
}
}
Expand Down

0 comments on commit 8165cbd

Please sign in to comment.