Я пытаюсь получить обратный вызов recaptcha, работающий с vue.js в компоненте. Сама капча работает, но не обратный вызов, который я определяю в атрибуте data-callback
.
Я перепробовал все, что мог придумать, но все равно получаю, что ReCAPTCHA couldn't find user-provided function: dothisthat
.
Вот этот компонент
<script>
function dothisthat (){
alert(312);
}
</script>
<template>
<div class="well main-well">
<h4>Captcha</h4>
<p class="small">You must complete the captcha to finish your booking.</p>
<div id="captcha-wrapper">
<div class="g-recaptcha" :data-sitekey="captchaKey" data-callback="dothisthat"></div>
</div>
</div>
</template>
<script>
function dothisthat (){
alert(123);
}
import * as filters from '../../../filters';
import Translation from '../../../Translation';
export default {
name: 'Captcha',
props: {
},
computed: {
captchaKey: function() {
return this.$store.getters.captcha;
}
},
methods: {
dothisthat: function(){
return function() {
console.log("123");
};
}
},
mounted(){
function dothisthat() {
alert(123);
}
$(function() {
function dothisthat() {
alert(123);
}
});
}
}
</script>
Ни одна из dothisthat
функций не dothisthat
. Что я делаю неправильно?