Giter Site home page Giter Site logo

vue-captcha-code's Introduction

vue-captcha-code

Project setup

npm i @johnnyguan/vue-captcha-code

Description

This project is aimed to show captcha code (length: 4) by canvas. The captcha code can either be passed as a variable or be generated by default.

Usage

main.js

import Vue from 'vue'
import App from './App.vue'
import VueCaptchaCode from '@johnnyguan/vue-captcha-code'
Vue.use(VueCaptchaCode)
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
}).$mount('#app')

XXX.vue

<captcha-code ref="code"></captcha-code>

Configuration

属性名 描述 值类型 默认值
height canvas高度 Number 80
width canvas宽度 Number 40
captcha captcha code String(4) 不传则内部生成
enableClick 是否点击canvas更新captcha Boolean false
fontSize 字体大小 String '20'
fontWeight 字体粗细 String 'normal' 可选'bold','bolder', '100'等
fontFace 字体类型 String 'serif'
fontStyle 字体样式 String 'normal' 可选'italic','oblique'
textFillColor 字体颜色 String '#ff0000'

Method

this.$refs.code.getCode()

vue-captcha-code's People

Contributors

johnnyguan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.