vue TencentCaptcha腾讯验证码

首先在index.html引入相应js:

<script src="https://ssl.captcha.qq.com/TCaptcha.js"></script>

然后在对应的页面创建对象:

 mounted: function () {
      this.captcha = new window.TencentCaptcha('xxxxx', function (res) {
        if (res.ret === 0) {
            //执行逻辑
        }
      })
    },  

  

posted @ 2019-12-03 18:02  kkaiboo  阅读(4917)  评论(0编辑  收藏  举报