mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(Tabs): use nextTick before marker calc (#2020)
This commit is contained in:
@@ -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'
|
||||
@@ -164,7 +164,10 @@ export default defineComponent({
|
||||
calcMarkerSize(selectedIndex.value)
|
||||
})
|
||||
|
||||
onMounted(() => calcMarkerSize(selectedIndex.value))
|
||||
onMounted(async () => {
|
||||
await nextTick()
|
||||
calcMarkerSize(selectedIndex.value)
|
||||
})
|
||||
|
||||
provideUseId(() => useId())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user