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