vue3-captcha
TypeScript icon, indicating that this package has built-in type declarations

0.3.4 • Public • Published

About

A canvas captcha built in Vue3 with TypeScript

Install

npm i -S vue3-captcha

Use

<script setup lang="ts">
import {ref} from "vue"
import Captcha,{CaptchaInstance}  from 'vue3-captcha';
let value=ref('')
let refCode=ref<CaptchaInstance>(null)
const handleCheck=()=>{
  if(refCode.value?.check(value.value)){
    console.log("check success")
  }
}

</script>

<template>
 <Captcha ref="refCode" />
 <input v-model="value">
 <button @click="handleCheck">校验</button>
</template>

Props

attr type default remark
width Number|String 120 width
height Number|String 40 height
borderColor String rgba(0,0,0,0.1) border-color
bgColor String #ffffff background-color
clickRefresh Boolean true click refresh
failRefresh Boolean false verification failed, refresh

Methods

method params return remark
refresh void refresh
check value true/false verification value

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.418latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.418
0.3.30
0.3.20
0.3.10
0.3.00
0.2.90
0.2.80
0.2.70
0.2.60
0.2.50
0.2.40
0.2.30
0.2.20
0.2.10
0.0.87
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i vue3-captcha

Weekly Downloads

17

Version

0.3.4

License

MIT

Unpacked Size

14.6 kB

Total Files

6

Last publish

Collaborators

  • webcoder