• 一个基于原生JavaScript开发的、轻量的验证码生成插件


    Vcode.js

    一个基于原生JavaScript开发的、轻量的验证码生成插件

    V: 1.0.0

    DEMO:https://jofunliang.github.io/Vcode.js/example.html

    安装

    <script src="Vcode.min.js"></script>
    

    OR

    // ES6 Modules or TypeScript
    import vcode from 'Vcode'
    
    // CommonJS
    const vcode = require('Vcode')
    

    Support AMD/CMD/ES6 module standard.

    使用示例

    var vcode1 = new Vcode({
      el:"#demo1 .code",
      count:4,	
      fontSize:"60px",
      type:"number",
      spacing:0
    });
    
    

    参数

    attribute typeof description
    el string 必需,接受一个包含CSS选择符的字符串,然后用它来匹配一个元素。
    data string 可选,您可以自定义验证码的数据源。
    count number 可选,验证码的长度,默认为4
    type string 可选,验证码的类型,有三种模式,分别是数字模式、字母模式、数字字母随机混合模式。默认是数字字母随机混合模式
    fontSize string 可选,验证码的字体大小。
    spacing string 可选,验证码的字母间距。默认值为0

    new Vcode对象的属性和方法

    property typeof description
    el object 挂载元素。
    code string 验证码。
    data string 验证码的数据源。
    count number 验证码的长度。
    onReset function 重新生成新的验证码。

    注:此插件在ie8和ie9浏览器上会降级显示。

  • 相关阅读:
    类的专有方法(__getitem__和__setitem__)
    类的专有方法(__len__)
    demo02
    python之函数用法__str__()
    repr
    类的专有方法(__repr__)
    类的专有方法(__del__)
    类的专有方法(__init__)
    静态方法
    Golang接口简单了解
  • 原文地址:https://www.cnblogs.com/jofun/p/9047295.html
Copyright © 2020-2023  润新知