mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [tabs] avoid resizeObserver loop when updating tab nav (#22966)
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
definePropType,
|
||||
getEventCode,
|
||||
mutable,
|
||||
rAF,
|
||||
throwError,
|
||||
} from '@element-plus/utils'
|
||||
import { EVENT_CODE } from '@element-plus/constants'
|
||||
@@ -325,7 +326,9 @@ const TabNav = defineComponent({
|
||||
}
|
||||
})
|
||||
|
||||
useResizeObserver(el$, update)
|
||||
useResizeObserver(el$, () => {
|
||||
rAF(update)
|
||||
})
|
||||
|
||||
onMounted(() => setTimeout(() => scrollToActiveTab(), 0))
|
||||
onUpdated(() => update())
|
||||
|
||||
Reference in New Issue
Block a user