very-code

自动生成验证码

Usage no npm install needed!

<script type="module">
  import veryCode from 'https://cdn.skypack.dev/very-code';
</script>

README

very-code

useage

  1. install
npm i very-code -S
  1. 引入库
import veryCode from 'very-code'
  1. 在页面上创建一个div,添加id,例如:
<div id="vc"></div>
  1. 生成验证码
let code = veryCode('vc')
  1. 可选参数:
/**
 * @param {*} id 容器的id
 * @param {*} option 可选
 * fontSize: 设置字体大小,默认24px
 * font: 设置字体,默认 :serif
 * x: 设置文本绘制的起始位置,默认 15px
 * y: 25,
 * num: 默认4
 * lineNum: 设置线段个数 默认10
 */