mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
style(sth): 代码微改
This commit is contained in:
24
src/App.vue
24
src/App.vue
@@ -12,25 +12,31 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import TSidebar from "./components/t-sidebar.vue";
|
||||
import useAppStore from "./store/modules/app";
|
||||
import { TGAppDataList, TGGetDataList } from "./data";
|
||||
import { fs } from "@tauri-apps/api";
|
||||
import { BaseDirectory } from "@tauri-apps/api/fs";
|
||||
// vue
|
||||
import { onMounted } from "vue";
|
||||
import TSidebar from "./components/t-sidebar.vue";
|
||||
// tauri
|
||||
import { fs } from "@tauri-apps/api";
|
||||
// store
|
||||
import useAppStore from "./store/modules/app";
|
||||
// utils
|
||||
import { InitTGData, DeleteTGData, WriteTGData } from "./utils/TGIndex";
|
||||
// data
|
||||
import { TGAppDataList, TGGetDataList } from "./data";
|
||||
|
||||
const appStore = useAppStore();
|
||||
|
||||
onMounted(async () => {
|
||||
await checkLoad();
|
||||
});
|
||||
|
||||
async function checkLoad() {
|
||||
await appStore.check();
|
||||
if (appStore.loading) {
|
||||
console.log("数据已加载!");
|
||||
return;
|
||||
}
|
||||
await DeleteTGData();
|
||||
DeleteTGData();
|
||||
await createDataDir();
|
||||
await writeData();
|
||||
await writeIndex();
|
||||
@@ -40,9 +46,9 @@ async function checkLoad() {
|
||||
// 创建数据文件夹
|
||||
async function createDataDir() {
|
||||
console.log("开始创建数据文件夹...");
|
||||
await fs.createDir("appData", { dir: BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("userData", { dir: BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("tempData", { dir: BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("appData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("userData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
|
||||
await fs.createDir("tempData", { dir: fs.BaseDirectory.AppLocalData, recursive: true });
|
||||
console.log("数据文件夹创建完成!");
|
||||
}
|
||||
// 将数据写入文件夹
|
||||
|
||||
@@ -65,12 +65,6 @@ const props = defineProps({
|
||||
color: #f4d8a8;
|
||||
}
|
||||
|
||||
.loading-subtitle {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 500;
|
||||
color: #38393a;
|
||||
}
|
||||
|
||||
.loading-img {
|
||||
width: 256px;
|
||||
height: 256px;
|
||||
@@ -78,10 +72,4 @@ const props = defineProps({
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.loading-text {
|
||||
font-size: 1.5rem;
|
||||
font-weight: 500;
|
||||
color: #38393a;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -26,11 +26,7 @@
|
||||
<v-card-actions>
|
||||
<v-btn @click="toPost(item.post_id)" class="ms-2 card-btn">
|
||||
<template v-slot:prepend>
|
||||
<img
|
||||
src="../assets/icons/arrow-right.svg"
|
||||
alt="right"
|
||||
onload="SVGInject(this)"
|
||||
/>
|
||||
<img src="../assets/icons/arrow-right.svg" alt="right" onload="SVGInject(this)" />
|
||||
</template>
|
||||
查看
|
||||
</v-btn>
|
||||
@@ -57,11 +53,7 @@
|
||||
<v-card-actions>
|
||||
<v-btn @click="toPost(item.post_id)" class="ms-2 card-btn">
|
||||
<template v-slot:prepend>
|
||||
<img
|
||||
src="../assets/icons/arrow-right.svg"
|
||||
alt="right"
|
||||
onload="SVGInject(this)"
|
||||
/>
|
||||
<img src="../assets/icons/arrow-right.svg" alt="right" onload="SVGInject(this)" />
|
||||
</template>
|
||||
查看
|
||||
</v-btn>
|
||||
@@ -90,11 +82,7 @@
|
||||
<v-card-actions>
|
||||
<v-btn @click="toPost(item.post_id)" class="ms-2 card-btn">
|
||||
<template v-slot:prepend>
|
||||
<img
|
||||
src="../assets/icons/arrow-right.svg"
|
||||
alt="right"
|
||||
onload="SVGInject(this)"
|
||||
/>
|
||||
<img src="../assets/icons/arrow-right.svg" alt="right" onload="SVGInject(this)" />
|
||||
</template>
|
||||
查看
|
||||
</v-btn>
|
||||
|
||||
@@ -35,10 +35,10 @@ export async function InitTGData() {
|
||||
/**
|
||||
* @description 删除数据库
|
||||
* @since Alpha
|
||||
* @return {Promise<void>}
|
||||
* @return {void}
|
||||
*/
|
||||
export async function DeleteTGData() {
|
||||
await window.indexedDB.deleteDatabase(DB_NAME);
|
||||
export function DeleteTGData() {
|
||||
window.indexedDB.deleteDatabase(DB_NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user