我正在尝试将recaptcha合并到vue中。js,我也在使用Laravel 5.6.7
验证码Vue包
https://github.com/DanSnow/vue-recaptcha#install
刀身
<div class="col-md-8"> <login></login> </div>
应用程序。js公司
import VueRecaptcha from 'vue-recaptcha'; Vue.use(VueRecaptcha); Vue.component('login', require('./components/login.vue'));
vue中的登录组件。js公司
<template> <div> <div class="form-group row"> <div class="col-md-6"> <div class="g-recaptcha" data-sitekey="My site key"> </div> </div> </div> </div> </template>
问题
我放置了用于验证码的div,但它没有呈现任何内容。我遗漏了什么吗?
如中所述 documentation ,VueRecaptcha已导入并添加到组件中。
import VueRecaptcha from 'vue-recaptcha'; export default { ... components: { VueRecaptcha } };
在模板中,声明使用 vue-recaptcha 标签
vue-recaptcha
<vue-recaptcha sitekey="Your key here"> <button>Click me</button> </vue-recaptcha>