首页 > 技术文章 > vue TencentCaptcha腾讯验证码

kaibo520 2019-12-03 18:02 原文

首先在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) {
            //执行逻辑
        }
      })
    },  

  

推荐阅读