Skip to content

Commit 7582397

Browse files
committed
Refactor GistList component to improve description display. Removed redundant title element and added a dedicated section for Gist descriptions, enhancing readability. Updated styles for better visual presentation of descriptions.
1 parent 5b7a8d3 commit 7582397

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/GistList.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
<a-card v-for="gist in gists" :key="gist.id" class="gist-card">
1414
<template #title>
1515
<a-space>
16-
<a-typography-title :heading="6" style="margin: 0">
17-
{{ gist.description || '未命名 Gist' }}
18-
</a-typography-title>
16+
1917
<a-tag>{{ formatDate(gist.created_at) }}</a-tag>
2018
<a-tag :color="gist.public ? 'green': 'red'">
2119
{{ gist.public ? '公开' : '私有'}}
@@ -51,6 +49,11 @@
5149
</a-space>
5250
</template>
5351

52+
<template v-if="gist.description">
53+
<div class="gist-description">
54+
{{ gist.description }}
55+
</div>
56+
</template>
5457
<a-collapse @change="handleCollapseChange">
5558
<a-collapse-item v-for="(file, filename) in gist.files" :key="filename" :header="String(filename)">
5659
<template #extra>
@@ -290,4 +293,11 @@ const clearToken = () => {
290293
.float-buttons:hover {
291294
transform: translateY(-4px);
292295
}
296+
297+
.gist-description {
298+
margin-bottom: 16px;
299+
color: var(--color-text-2);
300+
white-space: pre-wrap;
301+
word-break: break-word;
302+
}
293303
</style>

0 commit comments

Comments
 (0)