1 verificationCode() {
2       let captcha1 = new CaptchaMini()
3       captcha1.draw(document.querySelector('#captcha1'), r => {
4         this.Verification = r
5       })
6  },

先在要用的组件中引入 

import CaptchaMini from '../../static/js/captcha.min.js'
 
然后写一个容器放验证码:
<canvas class="canvas_v" width="100" height="50" ></canvas>
 
最后把上面的代码在加载完dom后执行就可以了(
this.Verification写你自己的变量
 
captcha.min.js地址:https://blog-static.cnblogs.com/files/lyt520/captcha.min.js

相关文章:

  • 2021-07-01
  • 2022-01-13
  • 2022-12-23
  • 2021-11-08
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-05-02
猜你喜欢
  • 2021-09-29
  • 2021-11-21
  • 2022-12-23
  • 2021-06-23
  • 2021-05-01
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案