A really simple verification code (also called pin code) input component for Vue.js. Supports both number and text.
How to use it:
1. Import the component.
import CodeInput from "vue-verification-code-input";
2. Basic usage:
<template> <div id="app"> <CodeInput :loading="false" class="input" v-on:change="onChange" v-on:complete="onComplete" /> </div> </template>
export default { name: "app", components: { CodeInput }, methods: { onChange(v) { console.log("onChange ", v); }, onComplete(v) { console.log("onComplete ", v); } } };
3. All possible props:
type: { type: String, default: "number" // or text }, className: String, fields: { type: Number, default: 6 }, fieldWidth: { type: Number, default: 58 }, fieldHeight: { type: Number, default: 54 }, autoFocus: { type: Boolean, default: true }, disabled: { type: Boolean, default: false }, required: { type: Boolean, default: false }, title: String, change: Function, complete: Function, loading: { type: Boolean, default: false }
Preview:
Download Details:
Author: suweya
Live Demo: https://suweya.github.io/vue-verification-code-input/index.html
Download Link: https://github.com/suweya/vue-verification-code-input/archive/master.zip
Official Website: https://github.com/suweya/vue-verification-code-input
Install & Download:
# NPM
$ npm i vue-verification-code-input --save