59 lines
1.5 KiB
Vue
59 lines
1.5 KiB
Vue
<script setup lang="ts">
|
|
import {
|
|
InputOTP,
|
|
InputOTPGroup,
|
|
InputOTPSeparator,
|
|
InputOTPSlot,
|
|
Label,
|
|
} from "@heroui-vue/components";
|
|
|
|
import { useId } from "vue";
|
|
const otpLabelId0 = useId();
|
|
const otpLabelId1 = useId();
|
|
</script>
|
|
|
|
<template>
|
|
<div class="flex flex-col gap-6">
|
|
<div class="flex flex-col gap-2">
|
|
<Label :id="otpLabelId0">主要变体</Label>
|
|
<InputOTP
|
|
:aria-labelledby="otpLabelId0"
|
|
:max-length="6"
|
|
variant="primary"
|
|
>
|
|
<InputOTPGroup>
|
|
<InputOTPSlot :index="0" />
|
|
<InputOTPSlot :index="1" />
|
|
<InputOTPSlot :index="2" />
|
|
</InputOTPGroup>
|
|
<InputOTPSeparator />
|
|
<InputOTPGroup>
|
|
<InputOTPSlot :index="3" />
|
|
<InputOTPSlot :index="4" />
|
|
<InputOTPSlot :index="5" />
|
|
</InputOTPGroup>
|
|
</InputOTP>
|
|
</div>
|
|
<div class="flex flex-col gap-2">
|
|
<Label :id="otpLabelId1">次要变体</Label>
|
|
<InputOTP
|
|
:aria-labelledby="otpLabelId1"
|
|
:max-length="6"
|
|
variant="secondary"
|
|
>
|
|
<InputOTPGroup>
|
|
<InputOTPSlot :index="0" />
|
|
<InputOTPSlot :index="1" />
|
|
<InputOTPSlot :index="2" />
|
|
</InputOTPGroup>
|
|
<InputOTPSeparator />
|
|
<InputOTPGroup>
|
|
<InputOTPSlot :index="3" />
|
|
<InputOTPSlot :index="4" />
|
|
<InputOTPSlot :index="5" />
|
|
</InputOTPGroup>
|
|
</InputOTP>
|
|
</div>
|
|
</div>
|
|
</template>
|