mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
cbc9f8d66c
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
28 lines
543 B
Vue
28 lines
543 B
Vue
<script setup lang="ts">
|
|
import type { TabsItem } from '@nuxt/ui'
|
|
|
|
const items: TabsItem[] = [
|
|
{
|
|
label: 'Account',
|
|
icon: 'i-lucide-user'
|
|
},
|
|
{
|
|
label: 'Password',
|
|
icon: 'i-lucide-lock'
|
|
}
|
|
]
|
|
|
|
const active = ref('0')
|
|
|
|
// Note: This is for demonstration purposes only. Don't do this at home.
|
|
onMounted(() => {
|
|
setInterval(() => {
|
|
active.value = String((Number(active.value) + 1) % items.length)
|
|
}, 2000)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<UTabs v-model="active" :content="false" :items="items" class="w-full" />
|
|
</template>
|