From 03287697c32930e971778d1dc903f24bd4314f16 Mon Sep 17 00:00:00 2001 From: lt Date: Mon, 27 Apr 2026 21:20:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=95=B0=E6=8D=AE=E5=8A=A0=E8=BD=BD=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 topic-card-list 添加 v-if 条件渲染 - 添加空状态提示 - 增强调试信息(console.log) - 确保移动端卡片列表正确显示 --- platform/frontend/topics.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/platform/frontend/topics.html b/platform/frontend/topics.html index 5ae4394..abccae7 100644 --- a/platform/frontend/topics.html +++ b/platform/frontend/topics.html @@ -143,7 +143,7 @@ -
+
{{ topic.title }}
@@ -185,12 +185,20 @@ const TopicsApp = { data() { return { isLoggedIn: false, isAdmin: false, currentUser: { username: '' }, topics: [], filterStatus: '', selectedTopicIds: [], loadingTable: false } }, computed: { - filteredTopics() { if (!this.topics.length) return []; if (!this.filterStatus) return this.topics; return this.topics.filter(t => t.status === this.filterStatus); }, + filteredTopics() { + console.log('[DEBUG] filteredTopics called, filterStatus:', this.filterStatus, 'topics count:', this.topics.length); + if (!this.topics.length) { console.log('[DEBUG] topics is empty'); return []; } + if (!this.filterStatus) { console.log('[DEBUG] no filter, return all'); return this.topics; } + const result = this.topics.filter(t => t.status === this.filterStatus); + console.log('[DEBUG] filtered result count:', result.length); + return result; + }, countByStatus() { return (status) => this.topics.filter(t => t.status === status).length; } }, methods: { async fetchTopics() { this.loadingTable = true; + console.log('[DEBUG] fetchTopics called'); try { const token = localStorage.getItem('authToken'); const response = await fetch('/api/topics', { headers: { 'Authorization': 'Bearer ' + token } });