1.0.0 • Published 5 years ago

vue-otp-input v1.0.0

Weekly downloads
106
License
MIT
Repository
github
Last release
5 years ago

vue-otp-input

How to Install

npm install vue-otp-input --save

codesandbox example

https://codesandbox.io/s/x72or1nyvw

How to use it

<template>
  <div>
    <OTPInput
      :isDisabled="isDisabled"
      :isError="isError"
      :onChangeOTP="onChangeOTP"
      :shouldResetOTP="shouldResetOTP"
      :numberOfInput="6"
    />
  </div>
</template>

<script>
import OTPInput from "vue-otp-input";

export default {
  name: "app",

  components: {
    OTPInput
  },

  data() {
    return {
      otp: null,
      isDisabled: false,
      isError: false,
      shouldResetOTP: false
    };
  },

  methods: {
    onChangeOTP(otp) {
      this.otp = otp;
    }
  }
};
</script>

Props

If you want to reset the OTP input then set the value of shouldResetOTP props as follows

this.shouldResetOTP = !this.shouldResetOTP;
Prop nametypedefault valueRequired Props
isDisabledBooleanfalsefalse
IsErrorBooleanfalsefalse
onChangeOTPFunctiontrue
shouldResetOTPBooleanfalsefalse
numberOfInputNumber4false
otpInputStyleObjectfalse
errorObjectfalse
1.0.0

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago