0.0.1 • Published 4 years ago

vue-recaptcha-eh v0.0.1

Weekly downloads
19
License
MIT
Repository
github
Last release
4 years ago

Captcha validation on Vue.js module

Features

  • Validation user
  • Change temp
  • Validate captcha code in realtime
Image
desktop

Getting started

Download

$ npm install vue-recaptcha-eh

Usage

ES6 modules

import VueRecaptchaEh from "../src/vue-recaptcha-eh";

Vue file

import VueRecaptchaEh from '/path/to/vue-recaptcha-eh.vue';

Example

<template>
  <vuerecaptchaeh v-on:getValidation="Validation" :option="option">
  </vuerecaptchaeh>
</template>

<script>
import VueRecaptchaEh from "../src/vue-recaptcha-eh";

export default {
  data() {
    return {
      option: {
        placeholder: "please Enter Code",
        textColor: "black",
        font: '17px "HiraKakuProN-W4-AlphaNum"',
        validColor: "green",
        inValidColor: "#E52B50"
      },
      validation: false
    };
  },
  methods: {
    Validation: function(target) {
      // target = true | false  it's mean a code is valid or invalid
      this.validation = target;
    }
  },
  components: {
    VueRecaptchaEh
  }
};
</script>

Options

OptionsTypeDescriptionDefault
invalidColorStringborder color input when code is valid'red'
validColorStringborder color input when code is invalid'green'
textColorStringordinary text colorblack
fontStringwave height17px "HiraKakuProN-W4-AlphaNum"
placeholderStringplaceholder on emptyPlease Enter Code

Callback

getValidation(target)

Argument
  • target : Boolean
ValuesTypeDescription
targetBooleantrue = Valid code & false = Invalid code

Quick Start

git clone https://github.com/EhsanSepehriNasab/vue-recaptcha-eh
cd vue-recaptcha-eh
npm install
vue serve example/App.vue

License

MIT