mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 11:47:55 +01:00
fix(Tabs): use nextTick before marker calc (#2020)
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<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 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 { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel, provideUseId } from '@headlessui/vue'
|
||||||
import { useResizeObserver } from '@vueuse/core'
|
import { useResizeObserver } from '@vueuse/core'
|
||||||
@@ -164,7 +164,10 @@ export default defineComponent({
|
|||||||
calcMarkerSize(selectedIndex.value)
|
calcMarkerSize(selectedIndex.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => calcMarkerSize(selectedIndex.value))
|
onMounted(async () => {
|
||||||
|
await nextTick()
|
||||||
|
calcMarkerSize(selectedIndex.value)
|
||||||
|
})
|
||||||
|
|
||||||
provideUseId(() => useId())
|
provideUseId(() => useId())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user