Skip to content

Commit 3cffa71

Browse files
committed
fix: topic detail page TOC
1 parent f5e49ac commit 3cffa71

6 files changed

Lines changed: 33 additions & 5 deletions

File tree

components/kun/icon/Markdown.vue

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<template>
2+
<svg
3+
xmlns="http://www.w3.org/2000/svg"
4+
width="15"
5+
height="15"
6+
viewBox="0 0 15 15"
7+
v-bind="$attrs"
8+
>
9+
<path
10+
fill="currentColor"
11+
d="m2.5 5.5l.354-.354A.5.5 0 0 0 2 5.5zm2 2l-.354.354l.354.353l.354-.353zm2-2H7a.5.5 0 0 0-.854-.354zm4 4l-.354.354l.354.353l.354-.353zM1.5 3h12V2h-12zm12.5.5v8h1v-8zm-.5 8.5h-12v1h12zM1 11.5v-8H0v8zm.5.5a.5.5 0 0 1-.5-.5H0A1.5 1.5 0 0 0 1.5 13zm12.5-.5a.5.5 0 0 1-.5.5v1a1.5 1.5 0 0 0 1.5-1.5zM13.5 3a.5.5 0 0 1 .5.5h1A1.5 1.5 0 0 0 13.5 2zm-12-1A1.5 1.5 0 0 0 0 3.5h1a.5.5 0 0 1 .5-.5zM3 10V5.5H2V10zm-.854-4.146l2 2l.708-.708l-2-2zm2.708 2l2-2l-.708-.708l-2 2zM6 5.5V10h1V5.5zm4-.5v4.5h1V5zM8.146 7.854l2 2l.708-.708l-2-2zm2.708 2l2-2l-.708-.708l-2 2z"
12+
/>
13+
</svg>
14+
</template>

components/kun/milkdown/Editor.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,16 @@ watch(
173173

174174
<div class="flex items-center justify-between text-sm">
175175
<slot name="footer" />
176-
<span> {{ `${textCount} 字` }} </span>
176+
177+
<div class="flex items-center gap-2">
178+
<KunBadge color="success">
179+
<KunIconMarkdown />
180+
Markdown 支持
181+
</KunBadge>
182+
<span>
183+
{{ `${textCount} 字` }}
184+
</span>
185+
</div>
177186
</div>
178187
</template>
179188
</div>

components/topic/reply/Reply.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ watch(
3333
}
3434
}
3535
)
36+
37+
const replyContent = computed(() => {
38+
const targetsContent = props.reply.targets.map((t) => t.replyContentMarkdown)
39+
const content = props.reply.contentMarkdown + targetsContent.join('')
40+
return markdownToText(content).slice(0, 20)
41+
})
3642
</script>
3743

3844
<template>
3945
<div
4046
class="outline-primary kun-reply flex justify-between gap-3 outline-offset-2"
41-
:id="`k${reply.floor}`"
47+
:id="`${reply.floor}.${replyContent}`"
4248
>
4349
<TopicDetailUser :user="reply.user" />
4450

components/topic/reply/ReplyList.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ const loadQuotedReply = async (
5858
<TopicReply
5959
v-for="reply in replies"
6060
:key="reply.id"
61-
:id="`k${reply.floor}`"
6261
:reply="reply"
6362
:title="title"
6463
:is-loading-target="isLoadingReply"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kun-galgame-nuxt3",
3-
"version": "4.0.8",
3+
"version": "4.0.9",
44
"packageManager": "pnpm@10.4.1",
55
"private": true,
66
"scripts": {

styles/editor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88

99
.milkdown .ProseMirror {
10-
@apply border-default-200 focus:ring-primary-200 focus:border-primary-500 min-h-[300px] rounded-lg border p-4 transition-colors duration-200 focus:ring-2 focus:outline-none;
10+
@apply focus:border-primary-500 border-default-200 focus:ring-primary-500 min-h-[300px] rounded-lg border p-4 shadow-sm transition-colors duration-200 focus:ring-1 focus:outline-none;
1111
}
1212

1313
.milkdown h1,

0 commit comments

Comments
 (0)