primevue-mirror/apps/showcase/doc/inputotp/BasicDoc.vue

55 lines
1.1 KiB
Vue
Raw Normal View History

2024-02-21 18:38:16 +00:00
<template>
<DocSectionText v-bind="$attrs">
2024-10-30 11:18:22 +00:00
<p>InputOtp is used with the <i>v-model</i> property for two-way value binding. The number of characters is defined with the <i>length</i> option, which is set to 4 by default.</p>
2024-02-21 18:38:16 +00:00
</DocSectionText>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2024-02-21 18:38:16 +00:00
<InputOtp v-model="value" />
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
value: null,
code: {
basic: `
<InputOtp v-model="value" />
`,
options: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2024-02-21 18:38:16 +00:00
<InputOtp v-model="value" />
</div>
</template>
<script>
export default {
data() {
return {
value: null
}
}
};
<\/script>
`,
composition: `
<template>
2024-05-20 12:14:38 +00:00
<div class="card flex justify-center">
2024-02-21 18:38:16 +00:00
<InputOtp v-model="value" />
</div>
</template>
<script setup>
import { ref } from 'vue';
const value = ref(null);
<\/script>
`
}
};
}
};
</script>