mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
51 lines
1.1 KiB
Vue
51 lines
1.1 KiB
Vue
<script setup lang="ts">
|
|
import type { StepperItem } from '@nuxt/ui'
|
|
|
|
const items: StepperItem[] = [
|
|
{
|
|
title: 'Address',
|
|
description: 'Add your address here',
|
|
icon: 'i-lucide-house'
|
|
}, {
|
|
title: 'Shipping',
|
|
description: 'Set your preferred shipping method',
|
|
icon: 'i-lucide-truck'
|
|
}, {
|
|
title: 'Checkout',
|
|
description: 'Confirm your order'
|
|
}
|
|
]
|
|
|
|
const stepper = useTemplateRef('stepper')
|
|
</script>
|
|
|
|
<template>
|
|
<div class="w-full">
|
|
<UStepper ref="stepper" :items="items">
|
|
<template #content="{ item }">
|
|
<Placeholder class="aspect-video">
|
|
{{ item.title }}
|
|
</Placeholder>
|
|
</template>
|
|
</UStepper>
|
|
|
|
<div class="flex gap-2 justify-between mt-4">
|
|
<UButton
|
|
leading-icon="i-lucide-arrow-left"
|
|
:disabled="!stepper?.hasPrev"
|
|
@click="stepper?.prev()"
|
|
>
|
|
Prev
|
|
</UButton>
|
|
|
|
<UButton
|
|
trailing-icon="i-lucide-arrow-right"
|
|
:disabled="!stepper?.hasNext"
|
|
@click="stepper?.next()"
|
|
>
|
|
Next
|
|
</UButton>
|
|
</div>
|
|
</div>
|
|
</template>
|