fix(components): [tabs] avoid resizeObserver loop when updating tab nav (#22966)

This commit is contained in:
rzzf
2025-12-19 14:15:02 +08:00
committed by GitHub
parent 123cb136bb
commit fc2a003ff8

View File

@@ -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())