mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-18 21:29:04 +08:00
@@ -31,7 +31,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, reactive, ref, watch } from "vue";
|
||||
import { nextTick, onMounted, reactive, ref, watch, useTemplateRef } from "vue";
|
||||
|
||||
interface ConfirmProps {
|
||||
title: string;
|
||||
@@ -56,7 +56,7 @@ const showOuter = ref<boolean>(false);
|
||||
const showInner = ref<boolean>(false);
|
||||
const confirmVal = ref<boolean | string | undefined>();
|
||||
const inputVal = ref<string>("");
|
||||
const inputRef = ref<HTMLInputElement>();
|
||||
const inputEl = useTemplateRef<HTMLInputElement>("inputRef");
|
||||
|
||||
watch(show, () => {
|
||||
if (show.value) {
|
||||
@@ -95,7 +95,7 @@ async function displayBox(
|
||||
if (data.mode === "input") {
|
||||
// 等待确认框打开,聚焦输入框
|
||||
setTimeout(() => {
|
||||
inputRef.value?.focus();
|
||||
inputEl.value?.focus();
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
</transition>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, useTemplateRef } from "vue";
|
||||
|
||||
const show = ref<boolean>(false);
|
||||
const showOuter = ref<boolean>(false);
|
||||
const showInner = ref<boolean>(false);
|
||||
|
||||
const geetestRef = ref<HTMLElement>(<HTMLElement>document.getElementById("geetest"));
|
||||
const geetestEl = useTemplateRef<HTMLDivElement>("geetestRef");
|
||||
|
||||
watch(show, () => {
|
||||
if (show.value) {
|
||||
@@ -55,7 +55,8 @@ async function displayBox(
|
||||
width: "250px",
|
||||
},
|
||||
(captchaObj: TGApp.Plugins.Mys.Geetest.GeetestCaptcha) => {
|
||||
geetestRef.value.innerHTML = "";
|
||||
if (geetestEl.value === null) return;
|
||||
geetestEl.value.innerHTML = "";
|
||||
captchaObj.appendTo("#geetest");
|
||||
captchaObj.onReady(() => {
|
||||
show.value = true;
|
||||
|
||||
Reference in New Issue
Block a user