mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
💄 列表缩进
This commit is contained in:
@@ -130,10 +130,7 @@ watch(curRegion, async (value) => {
|
||||
const name = getRegionName(value);
|
||||
await TGLogger.Info(`[Announcements][watch][curRegionName] 切换服务器:${name}`);
|
||||
await loadData();
|
||||
showSnackbar({
|
||||
text: `服务器切换为:${name}`,
|
||||
color: "success",
|
||||
});
|
||||
showSnackbar({ text: `服务器切换为:${name}`, color: "success" });
|
||||
});
|
||||
|
||||
watch(curLang, async (value) => {
|
||||
@@ -141,10 +138,7 @@ watch(curLang, async (value) => {
|
||||
const name = getLangName(value);
|
||||
await TGLogger.Info(`[Announcements][watch][curLangName] 切换语言:${name}`);
|
||||
await loadData();
|
||||
showSnackbar({
|
||||
text: `语言切换为:${name}`,
|
||||
color: "success",
|
||||
});
|
||||
showSnackbar({ text: `语言切换为:${name}`, color: "success" });
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { app, webviewWindow } from "@tauri-apps/api";
|
||||
import { ref, onMounted, watch, onUnmounted } from "vue";
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import TaParser from "../components/anno/ta-parser.vue";
|
||||
@@ -87,9 +87,7 @@ onMounted(async () => {
|
||||
// 打开 json
|
||||
const isDev = useAppStore().devMode ?? false;
|
||||
if (isDev) await createAnnoJson(annoId, region, lang);
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, 200);
|
||||
loading.value = false;
|
||||
});
|
||||
|
||||
watch(loadShare, (value) => {
|
||||
@@ -114,15 +112,6 @@ async function createAnnoJson(annoId: number, region: AnnoServer, lang: AnnoLang
|
||||
const jsonTitle = `Anno_${region}_${annoId}_${lang}_JSON`;
|
||||
await createTGWindow(jsonPath, "Dev_JSON", jsonTitle, 960, 720, false, false);
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
document
|
||||
.querySelector(".anno-body")
|
||||
?.querySelectorAll("img")
|
||||
.forEach((img) => {
|
||||
if (img.src.startsWith("blob:")) URL.revokeObjectURL(img.src);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.anno-info {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file web/utils/annoParser.ts
|
||||
* @description 解析游戏内公告数据
|
||||
* @since Beta v0.5.5
|
||||
* @since Beta v0.6.0
|
||||
*/
|
||||
|
||||
import { h, render } from "vue";
|
||||
@@ -105,7 +105,7 @@ export function parseAnnoContent(
|
||||
|
||||
/**
|
||||
* @description 解析公告节点
|
||||
* @since Beta v0.5.3
|
||||
* @since Beta v0.6.0
|
||||
* @param {Node} node - 节点
|
||||
* @param {Record<string, string>} attr - 属性
|
||||
* @returns {TGApp.Plugins.Mys.SctPost.Base} 结构化数据
|
||||
@@ -146,6 +146,19 @@ function parseAnnoNode(
|
||||
Array.from(element.children).forEach((child) => {
|
||||
res.push(...parseAnnoNode(child, attr));
|
||||
});
|
||||
for (const comp of res) {
|
||||
if (comp.children) {
|
||||
for (const child of comp.children) {
|
||||
if (child.insert !== "" && child.insert !== "\n") {
|
||||
child.insert = ` ${child.insert}`;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (comp.insert !== "" && comp.insert !== "\n") {
|
||||
comp.insert = ` ${comp.insert}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
if (element.tagName === "DETAILS") {
|
||||
|
||||
Reference in New Issue
Block a user