fix: captcha ref not defined

This commit is contained in:
Tony Yang
2025-04-17 02:04:35 +08:00
parent ceda1e8c1c
commit 8a952e3251
5 changed files with 14 additions and 7 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
<script setup>
import { ref, watch, computed } from 'vue';
import { ref, watch, computed, useTemplateRef } from 'vue';
import CAPTCHA from '../CAPTCHA.vue';
const emit = defineEmits(['login-submit']);
@@ -7,6 +7,7 @@ const emit = defineEmits(['login-submit']);
const username = ref('');
const password = ref('');
const captcha = useTemplateRef('captcha');
const captchaResponse = ref(null);
const captchaVerified = computed(() => {
return captchaResponse.value !== null;
@@ -91,6 +92,7 @@ const submit = () => {
</div>
</div>
<CAPTCHA
ref="captcha"
:hcaptchaSitekey="$hcaptchaSitekey"
:recaptchaSitekey="$recaptchaSitekey"
:turnstileSitekey="$turnstileSitekey"