diff --git a/src/views/Home/content/article/components/ArticleContent.vue b/src/views/Home/content/article/components/ArticleContent.vue index 423f1dd0..700517cd 100644 --- a/src/views/Home/content/article/components/ArticleContent.vue +++ b/src/views/Home/content/article/components/ArticleContent.vue @@ -83,9 +83,18 @@ watch( transition: all 0.5s ease; } +.list-enter-from, +.list-leave-to { + opacity: 0; +} + +/* 确保将离开的元素从布局流中删除 + 以便能够正确地计算移动的动画。 */ .list-leave-active { - opacity: 0; /* 逐渐消失 */ - height: 0; /* 高度逐渐减少 */ - margin-top: 0; /* 确保没有上边距 */ + /** + * 宽度为单个话题总宽度减去用户部分的宽度,这里为 2 + 5 + 60 + 5 + 2 = 74px + */ + width: calc(100% - 74px); + position: absolute; } diff --git a/src/views/Home/content/article/components/SingleTopic.vue b/src/views/Home/content/article/components/SingleTopic.vue index 6f40b51c..9b6c4eb2 100644 --- a/src/views/Home/content/article/components/SingleTopic.vue +++ b/src/views/Home/content/article/components/SingleTopic.vue @@ -25,6 +25,7 @@ const props = defineProps(['data']) padding: 5px; background-color: var(--kungalgame-trans-white-5); display: flex; + flex-shrink: 0; &:hover { background-color: var(--kungalgame-white); transition: 0.2s; @@ -32,8 +33,11 @@ const props = defineProps(['data']) &:last-child { margin-bottom: 0; } + /** + * 宽度为单个话题总宽度减去用户部分的宽度,这里为 2 + 5 + 60 + 5 + 2 = 74px + */ a { - width: 100%; + width: calc(100% - 74px); } } diff --git a/src/views/Home/content/article/components/TopicPart.vue b/src/views/Home/content/article/components/TopicPart.vue index f7b17ca4..754da221 100644 --- a/src/views/Home/content/article/components/TopicPart.vue +++ b/src/views/Home/content/article/components/TopicPart.vue @@ -20,15 +20,13 @@ const plainText = getPlainText(props.data.content)
-
+
-
-
- {{ props.data.title }} -
+
+ {{ props.data.title }}
-
+
  • {{ @@ -44,24 +42,24 @@ const plainText = getPlainText(props.data.content) {{ props.data.replies }}
-
- -
+ -
-
-

- {{ plainText }} -

-
+
+

+ {{ plainText }} +

@@ -72,50 +70,33 @@ const plainText = getPlainText(props.data.content) height: 100%; display: flex; flex-direction: column; + color: var(--kungalgame-font-color-3); } -/* 话题的概览信息 */ -.topic-summary, -.topic-introduction { - width: 100%; - height: 1px; -} + /* 话题展示的头部 */ -.topic-summary { - flex-grow: 1; +.summary { + width: 100%; /* 头部三个小部分为弹性盒 */ display: flex; justify-content: space-between; } /* 话题的头部信息,标题日期等 */ -.topic-title { +.title { + width: 100%; height: 100%; - width: 1px; -} -/* 发帖标题 */ -.topic-title { - flex-grow: 5; /* 超出不换行省略 */ display: flex; align-items: center; -} -/* 设置标题容器不换行显示省略号 */ -.topic-title-container { display: inline-block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -/* 话题标题的字体颜色 */ -.topic-title span { - color: var(--kungalgame-font-color-3); - font-weight: 500; -} + /* 话题点赞数等信息 */ -.topic-status { +.status { display: flex; - justify-content: end; align-items: center; - overflow: hidden; white-space: nowrap; ul { display: flex; @@ -133,7 +114,7 @@ const plainText = getPlainText(props.data.content) } } /* 发帖日期 */ -.topic-post-date { +.time { width: 60px; font-size: x-small; color: var(--kungalgame-font-color-0); @@ -146,14 +127,10 @@ const plainText = getPlainText(props.data.content) white-space: nowrap; } /* 话题的预览介绍 */ -.topic-introduction { - flex-grow: 2; +.introduction { + width: 100%; display: flex; align-items: center; -} -/* 文本域盒子 */ -.topic-introduction-text { - width: 100%; /* 设置文本超过两行就显示省略号 */ overflow: hidden; text-overflow: ellipsis; @@ -162,10 +139,10 @@ const plainText = getPlainText(props.data.content) overflow: hidden; -webkit-box-orient: vertical; cursor: pointer; -} -/* 发帖预览信息的字体 */ -.topic-introduction-text p { - font-size: 14px; - color: var(--kungalgame-font-color-2); + p { + width: 100%; + font-size: 14px; + color: var(--kungalgame-font-color-2); + } }