🐛 修复特定条件下的渲染异常

This commit is contained in:
BTMuli
2026-02-08 18:29:48 +08:00
parent b7d875b0d0
commit 8dd8635c04
5 changed files with 24 additions and 21 deletions

View File

@@ -1,8 +1,8 @@
<template>
<component
:is="getTpName(tp)"
v-for="(tp, index) in getParsedData(props.data)"
:key="index"
:is="getTpName(tp)"
:data="tp"
/>
</template>
@@ -44,6 +44,7 @@ function getParsedData(data: SctPostDataArr): SctPostDataArr {
continue;
}
if (tpName !== TpText) {
if (child.length > 0) res.push(...child);
cur = tp;
child = [];
res.push(cur);

View File

@@ -70,18 +70,14 @@
</div>
</v-menu>
</div>
<VpReplyDebug v-if="devMode" v-model="showDebug" />
</template>
<script lang="ts" setup>
import showSnackbar from "@comp/func/snackbar.js";
import postReq from "@req/postReq.js";
import useAppStore from "@store/app.js";
import { emit } from "@tauri-apps/api/event";
import TGLogger from "@utils/TGLogger.js";
import { storeToRefs } from "pinia";
import { computed, ref, shallowRef, watch } from "vue";
import VpReplyDebug from "./vp-reply-debug.vue";
import VpReplyItem from "./vp-reply-item.vue";
/**
@@ -116,8 +112,6 @@ type SelectItem = {
value: ReplyOrderType;
};
const { devMode } = storeToRefs(useAppStore());
const props = defineProps<TprMainProps>();
const orderList: Array<SelectItem> = [
@@ -131,7 +125,6 @@ const lastId = ref<string>();
const isLast = ref<boolean>(false);
const loading = ref<boolean>(false);
const showOverlay = ref<boolean>(false);
const showDebug = ref<boolean>(false);
const onlyLz = ref<boolean>(false);
const orderType = ref<ReplyOrderType>(ReplyOrderType.HOT);
const reply = shallowRef<Array<TGApp.BBS.Reply.ReplyFull>>([]);
@@ -212,11 +205,6 @@ async function loadReply(): Promise<void> {
}
async function handleDebug(): Promise<void> {
if (devMode.value) {
showDebug.value = true;
return;
}
if (showDebug.value) showDebug.value = false;
await reloadReply();
}
</script>

View File

@@ -4,7 +4,7 @@
<div class="tpr-debug-title">
<span>文件</span>
<span :title="filePath">{{ filePath }}</span>
<v-btn @click="selectFile" color="primary">选择文件</v-btn>
<v-btn size="small" @click="selectFile" color="primary">选择文件</v-btn>
</div>
<div class="tpr-debug-reply">
<TprReply mode="main" :modelValue="replyData" v-if="replyData !== null" pinId="0" />
@@ -56,28 +56,32 @@ async function selectFile(): Promise<void> {
position: relative;
display: flex;
width: 800px;
max-height: 600px;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 5px;
border-radius: 5px;
padding: 8px;
border-radius: 4px;
background: var(--box-bg-1);
box-shadow: 0 0 5px var(--common-shadow-1);
row-gap: 8px;
}
.tpr-debug-title {
position: relative;
display: flex;
overflow: hidden;
width: 100%;
flex-shrink: 0;
align-items: center;
justify-content: flex-start;
padding: 5px;
padding: 4px;
border-bottom: 1px solid var(--box-bg-2);
font-family: var(--font-title);
text-overflow: ellipsis;
white-space: nowrap;
:nth-child(2) {
span:nth-child(2) {
overflow: hidden;
max-width: 600px;
margin-right: auto;