Skip to content

Commit

Permalink
fix(Tabs): use nextTick before marker calc (#2020)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong authored Aug 5, 2024
1 parent 606c7b6 commit 9c04969
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/components/navigation/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</template>

<script lang="ts">
import { toRef, ref, watch, onMounted, defineComponent } from 'vue'
import { toRef, ref, watch, onMounted, defineComponent, nextTick } from 'vue'
import type { PropType } from 'vue'
import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel, provideUseId } from '@headlessui/vue'
import { useResizeObserver } from '@vueuse/core'
Expand Down Expand Up @@ -164,7 +164,10 @@ export default defineComponent({
calcMarkerSize(selectedIndex.value)
})
onMounted(() => calcMarkerSize(selectedIndex.value))
onMounted(async () => {
await nextTick()
calcMarkerSize(selectedIndex.value)
})
provideUseId(() => useId())
Expand Down

0 comments on commit 9c04969

Please sign in to comment.