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)
- {{ plainText }} -
-+ {{ plainText }} +