👽️ 更新依赖,调整公告Api

https://github.com/Scighost/Starward/issues/1089
This commit is contained in:
目棃
2024-09-13 16:03:19 +08:00
parent 611ae19c5e
commit 3740cea15b
7 changed files with 548 additions and 549 deletions

View File

@@ -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);
}
});

View File

@@ -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;