fix: 暂无会话适配

This commit is contained in:
tim
2025-08-23 01:02:35 +08:00
parent e8e7b9a245
commit 2f261983ac
3 changed files with 40 additions and 23 deletions

View File

@@ -28,6 +28,13 @@
</div>
</template>
</BaseTimeline>
<div class="empty-container">
<BasePlaceholder
v-if="messages.length === 0"
text="暂无会话,发送消息试试 🎉"
icon="fas fa-inbox"
/>
</div>
</template>
</div>
@@ -57,6 +64,7 @@ import { useWebSocket } from '~/composables/useWebSocket'
import { useUnreadCount } from '~/composables/useUnreadCount'
import TimeManager from '~/utils/time'
import BaseTimeline from '~/components/BaseTimeline.vue'
import BasePlaceholder from '~/components/BasePlaceholder.vue'
const config = useRuntimeConfig()
const route = useRoute()

View File

@@ -8,14 +8,14 @@
<div class="error-text">{{ error }}</div>
</div>
<div v-else-if="conversations.length === 0" class="empty-container">
<div class="empty-text">暂无会话</div>
</div>
<div v-if="!loading" class="search-container">
<SearchDropdown />
</div>
<div v-if="!loading && conversations.length === 0" class="empty-container">
<BasePlaceholder v-if="conversations.length === 0" text="暂无会话" icon="fas fa-inbox" />
</div>
<div
v-if="!loading"
v-for="convo in conversations"
@@ -67,6 +67,7 @@ import { useUnreadCount } from '~/composables/useUnreadCount'
import TimeManager from '~/utils/time'
import { stripMarkdownLength } from '~/utils/markdown'
import SearchDropdown from '~/components/SearchDropdown.vue'
import BasePlaceholder from '~/components/BasePlaceholder.vue'
const config = useRuntimeConfig()
const conversations = ref([])