mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
🎨 nextTick 部分应用
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { dialog, fs } from "@tauri-apps/api";
|
||||
import { computed, onBeforeMount, onMounted, ref } from "vue";
|
||||
import { computed, nextTick, onBeforeMount, onMounted, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
@@ -175,9 +175,11 @@ onMounted(async () => {
|
||||
}).version;
|
||||
loadingTitle.value = "正在获取成就数据";
|
||||
selectedAchievement.value = await TGSqlite.getAchievements();
|
||||
loading.value = false;
|
||||
if (route.query.app) {
|
||||
await handleImportOuter(<string>route.query.app);
|
||||
await nextTick(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
if (route.query.app && typeof route.query.app === "string") {
|
||||
await handleImportOuter(route.query.app);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -236,7 +238,9 @@ async function selectSeries(index: number): Promise<void> {
|
||||
if (selectedSeries.value !== 0 && selectedSeries.value !== 17) {
|
||||
getCardInfo.value = await TGSqlite.getNameCard(index);
|
||||
}
|
||||
loading.value = false;
|
||||
await nextTick(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 打开图片
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { nextTick, onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
@@ -77,14 +77,16 @@ onMounted(async () => {
|
||||
loadingTitle.value = "正在获取公告数据";
|
||||
loading.value = true;
|
||||
annoData.value = await TGRequest.Anno.getList();
|
||||
loadingTitle.value = "正在转换公告数据";
|
||||
const listCards = TGUtils.Anno.getCard(annoData.value);
|
||||
tab.value = "activity";
|
||||
annoCards.value = {
|
||||
activity: listCards.filter((item) => item.typeLabel === AnnoType.activity),
|
||||
game: listCards.filter((item) => item.typeLabel === AnnoType.game),
|
||||
};
|
||||
loading.value = false;
|
||||
loadingTitle.value = "正在渲染公告数据";
|
||||
await nextTick(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
});
|
||||
|
||||
async function switchNews(): Promise<void> {
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onBeforeMount, onMounted, ref } from "vue";
|
||||
import { nextTick, onBeforeMount, onMounted, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
@@ -146,7 +146,7 @@ const loadingTitle = ref<string>("正在加载");
|
||||
const loadingSub = ref<boolean>(false);
|
||||
|
||||
// UI 数据
|
||||
const tab = ref<string>("");
|
||||
const tab = ref<NewsKey>("notice");
|
||||
const showList = ref<boolean>(false);
|
||||
const tabValues = ref<Array<NewsKey>>(["notice", "activity", "news"]);
|
||||
|
||||
@@ -190,17 +190,16 @@ async function firstLoad(key: NewsKey): Promise<void> {
|
||||
if (rawData.value[key].lastId !== 0) {
|
||||
return;
|
||||
}
|
||||
if (rawData.value[key].lastId === 0) {
|
||||
loadingTitle.value = `正在获取${rawData.value[key].name}数据...`;
|
||||
loading.value = true;
|
||||
const getData = await Mys.News.get(gid, NewsType[key]);
|
||||
rawData.value[key].isLast = getData.is_last;
|
||||
rawData.value[key].lastId = getData.list.length;
|
||||
postData.value[key] = Mys.News.card[key](getData);
|
||||
}
|
||||
setTimeout(() => {
|
||||
loadingTitle.value = `正在获取${rawData.value[key].name}数据...`;
|
||||
loading.value = true;
|
||||
const getData = await Mys.News.get(gid, NewsType[key]);
|
||||
rawData.value[key].isLast = getData.is_last;
|
||||
rawData.value[key].lastId = getData.list.length;
|
||||
postData.value[key] = Mys.News.card[key](getData);
|
||||
loadingTitle.value = `正在渲染${rawData.value[key].name}数据...`;
|
||||
await nextTick(() => {
|
||||
loading.value = false;
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
async function switchAnno(): Promise<void> {
|
||||
@@ -234,10 +233,10 @@ async function loadMore(key: NewsKey): Promise<void> {
|
||||
loading.value = false;
|
||||
return;
|
||||
}
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
await nextTick(() => {
|
||||
loadingSub.value = false;
|
||||
}, 1500);
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function searchPost(): void {
|
||||
|
||||
Reference in New Issue
Block a user