mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-30 12:52:43 +08:00
modify(tab)
This commit is contained in:
parent
52be5e2d00
commit
aca4847267
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user