modify(tab)

This commit is contained in:
songwanli2025@163.com 2020-02-19 15:05:49 +08:00
parent 52be5e2d00
commit aca4847267

View File

@ -95,6 +95,7 @@ import themeable from '../../_mixins/themeable'
import iosArrowBack from '../../_icons/ios-arrow-back'
import iosArrowForward from '../../_icons/ios-arrow-forward'
import mdClose from '../../_icons/md-close'
import resizeObserverDelegate from '../../_utils/delegate/resizeObserverDelegate'
export default {
name: 'NTabs',
@ -188,16 +189,15 @@ export default {
})
.then(() => {
this.updateScrollStatus()
updateBarPosition.bind(this)()
updateBarPosition.call(this)
})
this.resizeObserver = new ResizeObserver(() => {
resizeObserverDelegate.registerHandler(this.$refs.tab, () => {
this.transitionDisabled = true
updateBarPosition.bind(this)()
updateBarPosition.call(this)
this.$nextTick().then(() => {
this.transitionDisabled = false
})
})
this.resizeObserver.observe(this.$refs.tab)
},
updated () {
this
@ -207,7 +207,7 @@ export default {
})
},
beforeDestroy () {
this.resizeObserver.disconnect()
resizeObserverDelegate.unregisterHandler(this.$refs.tab)
},
methods: {
scroll (direction) {