🚚 t-loading → to-loading

This commit is contained in:
BTMuli
2023-05-26 14:49:50 +08:00
parent d962d52bd2
commit 4769731d52
7 changed files with 20 additions and 19 deletions

View File

@@ -22,7 +22,7 @@
</v-btn>
</template>
</v-app-bar>
<TLoading v-model="loading" :title="loadingTitle" />
<TOLoading v-model="loading" :title="loadingTitle" />
<div class="wrap">
<!-- 左侧菜单 -->
<div class="left-wrap">
@@ -108,7 +108,7 @@
<script lang="ts" setup>
// vue
import { onMounted, ref, onBeforeMount, computed } from "vue";
import TLoading from "../components/main/t-loading.vue";
import TOLoading from "../components/overlay/to-loading.vue";
// tauri
import { dialog, fs } from "@tauri-apps/api";
// Store

View File

@@ -91,7 +91,7 @@
// vue
import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";
import TLoading from "../components/main/t-loading.vue";
import TLoading from "../components/overlay/to-loading.vue";
// store
import { useAppStore } from "../store/modules/app";
// utils

View File

@@ -1,12 +1,12 @@
<template>
<TLoading v-model="loading" :title="loadingTitle" :subtitle="loadingSubtitle" />
<TOLoading v-model="loading" :title="loadingTitle" :subtitle="loadingSubtitle" />
<component :is="item" v-for="item in components" :key="item" :ref="setItemRef" />
</template>
<script lang="ts" setup>
// vue
import { markRaw, onMounted, onUnmounted, onUpdated, ref } from "vue";
import TLoading from "../components/main/t-loading.vue";
import TOLoading from "../components/overlay/to-loading.vue";
import TPool from "../components/main/t-pool.vue";
import TPosition from "../components/main/t-position.vue";
import TCalendar from "../components/main/t-calendar.vue";

View File

@@ -1,6 +1,6 @@
<template>
<TSwitchTheme />
<TLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<TOLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<div class="anno-json">
<div class="anno-title">
活动列表 JSON
@@ -17,7 +17,7 @@
import { ref, onMounted, reactive } from "vue";
import { useRoute } from "vue-router";
import JsonViewer from "vue-json-viewer";
import TLoading from "../components/main/t-loading.vue";
import TOLoading from "../components/overlay/to-loading.vue";
import TSwitchTheme from "../components/main/t-switchTheme.vue";
// tauri
import { appWindow } from "@tauri-apps/api/window";

View File

@@ -1,7 +1,7 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<TSwitchTheme />
<TLoading v-model="loading" :title="loadingTitle" :empty="loadingEmpty" />
<TOLoading v-model="loading" :title="loadingTitle" :empty="loadingEmpty" />
<div class="anno-body">
<div class="anno-title">
{{ annoData.title }}
@@ -17,7 +17,7 @@
// vue
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import TLoading from "../components/main/t-loading.vue";
import TOLoading from "../components/overlay/to-loading.vue";
import TSwitchTheme from "../components/main/t-switchTheme.vue";
// tauri
import { appWindow } from "@tauri-apps/api/window";
@@ -55,9 +55,7 @@ onMounted(async () => {
loadingTitle.value = "公告不存在或解析失败";
return;
}
setTimeout(() => {
loading.value = false;
}, 1200);
});
</script>
<style lang="css" src="../assets/css/anno-parser.css" scoped />

View File

@@ -1,6 +1,6 @@
<template>
<TSwitchTheme />
<TLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<TOLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<div class="post-json">
<div class="post-title">
帖子返回内容 JSON
@@ -13,7 +13,7 @@
import { ref, onMounted, reactive } from "vue";
import { useRoute } from "vue-router";
import JsonViewer from "vue-json-viewer";
import TLoading from "../components/main/t-loading.vue";
import TOLoading from "../components/overlay/to-loading.vue";
import TSwitchTheme from "../components/main/t-switchTheme.vue";
// tauri
import { appWindow } from "@tauri-apps/api/window";
@@ -39,10 +39,13 @@ onMounted(async () => {
}
// 获取数据
loadingTitle.value = "正在获取数据...";
try {
jsonData = await MysOper.Post.get(postId);
setTimeout(() => {
loading.value = false;
}, 200);
} catch (e) {
loadingTitle.value = "帖子不存在或解析失败";
loadingEmpty.value = true;
}
});
</script>
<style>

View File

@@ -1,14 +1,14 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<TSwitchTheme />
<TLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<TOLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
<div class="mys-post-body" v-html="postHtml" />
</template>
<script lang="ts" setup>
// vue
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import TLoading from "../components/main/t-loading.vue";
import TOLoading from "../components/overlay/to-loading.vue";
// tauri
import { appWindow } from "@tauri-apps/api/window";
// plugins