shadcn-vue/apps/www/src/lib/registry/new-york/example/PinInputDemo.vue
Sadegh Barati 6ab704a6fb
feat: pin input (#325)
* feat: pin input

* chore: build registry

* chore: build registry, add form example

* chore: update demo abit

---------

Co-authored-by: zernonia <zernonia@gmail.com>
2024-02-06 10:06:59 +08:00

29 lines
513 B
Vue

<script setup lang="ts">
import { ref } from 'vue'
import {
PinInput,
PinInputInput,
} from '@/lib/registry/new-york/ui/pin-input'
const value = ref<string[]>([])
function handleComplete() {
console.log('212121')
}
</script>
<template>
<PinInput
id="pin-input"
v-model="value"
placeholder="○"
class="flex gap-2 items-center mt-1"
@complete="handleComplete"
>
<PinInputInput
v-for="(id, index) in 5"
:key="id"
:index="index"
/>
</PinInput>
</template>