mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-14 09:38:13 +08:00
♻️ Mys 类型重构,优化目录结构
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<template>
|
||||
<TSwitchTheme />
|
||||
<TShareBtn v-show="!loadingEmpty" v-model="postRef" :title="shareTitle" />
|
||||
<TOLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
|
||||
<ToLoading v-model="loading" :empty="loadingEmpty" :title="loadingTitle" />
|
||||
<div class="mys-post-body">
|
||||
<div class="mys-post-title">
|
||||
{{ postRender.title }}
|
||||
@@ -18,26 +18,26 @@
|
||||
// vue
|
||||
import { ref, onMounted } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import TOLoading from "../components/overlay/to-loading.vue";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import TSwitchTheme from "../components/main/t-switchTheme.vue";
|
||||
import TShareBtn from "../components/main/t-shareBtn.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// plugins
|
||||
import MysOper from "../plugins/Mys";
|
||||
import Mys from "../plugins/Mys";
|
||||
|
||||
// loading
|
||||
const loading = ref(true as boolean);
|
||||
const loadingTitle = ref("正在加载");
|
||||
const loadingEmpty = ref(false as boolean);
|
||||
const loading = ref<boolean>(true);
|
||||
const loadingTitle = ref<string>("正在加载");
|
||||
const loadingEmpty = ref<boolean>(false);
|
||||
|
||||
// share
|
||||
const postRef = ref({} as HTMLElement);
|
||||
const shareTitle = ref("");
|
||||
const postRef = ref<HTMLElement>({} as HTMLElement);
|
||||
const shareTitle = ref<string>("");
|
||||
|
||||
// 数据
|
||||
const postId = Number(useRoute().params.post_id);
|
||||
const postHtml = ref("");
|
||||
const postHtml = ref<string>("");
|
||||
const postRender = ref({
|
||||
title: "",
|
||||
created: "",
|
||||
@@ -56,9 +56,9 @@ onMounted(async () => {
|
||||
// 获取数据
|
||||
loadingTitle.value = "正在获取数据...";
|
||||
try {
|
||||
const postData = await MysOper.Post.get(postId);
|
||||
const postData = await Mys.Post.get(postId);
|
||||
loadingTitle.value = "正在渲染数据...";
|
||||
postHtml.value = MysOper.Post.parser(postData);
|
||||
postHtml.value = Mys.Post.parser(postData);
|
||||
postRender.value = {
|
||||
title: postData.post.subject,
|
||||
created: new Date(postData.post.created_at * 1000).toLocaleString().replace(/\//g, "-"),
|
||||
|
||||
Reference in New Issue
Block a user