修复关闭其他标签没有滑到可视区域的bug
This commit is contained in:
parent
8f48604956
commit
8165cbd697
|
|
@ -116,7 +116,7 @@ export default {
|
||||||
let res = this.list.filter(item => routeEqual(this.currentRouteObj, item) || item.name === this.$config.homeName)
|
let res = this.list.filter(item => routeEqual(this.currentRouteObj, item) || item.name === this.$config.homeName)
|
||||||
this.$emit('on-close', res, 'others', this.currentRouteObj)
|
this.$emit('on-close', res, 'others', this.currentRouteObj)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.getTagElementByName(this.currentRouteObj.name)
|
this.getTagElementByRoute(this.currentRouteObj)
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -160,7 +160,7 @@ export default {
|
||||||
this.tagBodyLeft = -(tag.offsetLeft - (outerWidth - this.outerPadding - tag.offsetWidth))
|
this.tagBodyLeft = -(tag.offsetLeft - (outerWidth - this.outerPadding - tag.offsetWidth))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getTagElementByName (route) {
|
getTagElementByRoute (route) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.refsTag = this.$refs.tagsPageOpened
|
this.refsTag = this.$refs.tagsPageOpened
|
||||||
this.refsTag.forEach((item, index) => {
|
this.refsTag.forEach((item, index) => {
|
||||||
|
|
@ -186,7 +186,7 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route' (to) {
|
'$route' (to) {
|
||||||
this.getTagElementByName(to)
|
this.getTagElementByRoute(to)
|
||||||
},
|
},
|
||||||
visible (value) {
|
visible (value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
@ -198,7 +198,7 @@ export default {
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.getTagElementByName(this.$route)
|
this.getTagElementByRoute(this.$route)
|
||||||
}, 200)
|
}, 200)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue