From b5c402cfa4ce0ea1a0a21197560932969bf277b9 Mon Sep 17 00:00:00 2001 From: betavs Date: Tue, 24 Oct 2023 17:00:10 +0800 Subject: [PATCH] fix(tab-nav): arrow display is abnormal --- src/tabs/tab-nav.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tabs/tab-nav.tsx b/src/tabs/tab-nav.tsx index 8252c58e2e..0c34913278 100644 --- a/src/tabs/tab-nav.tsx +++ b/src/tabs/tab-nav.tsx @@ -1,4 +1,4 @@ -import { h, defineComponent, Transition, ref, computed, watch, onMounted } from 'vue'; +import { h, defineComponent, Transition, ref, computed, watch, onMounted, nextTick } from 'vue'; import debounce from 'lodash/debounce'; import { ChevronLeftIcon as TdChevronLeftIcon, @@ -137,8 +137,10 @@ export default defineComponent({ }); const totalAdjust = () => { - adjustArrowDisplay(); - adjustScrollLeft(); + nextTick(() => { + adjustArrowDisplay(); + adjustScrollLeft(); + }); }; // watch watch([scrollLeft, () => props.placement, () => props.panels], totalAdjust);