暂无热门话题
@@ -133,6 +180,7 @@ import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'
import { API_BASE_URL } from '../main'
import BaseTimeline from '../components/BaseTimeline.vue'
+import { stripMarkdown } from '../utils/markdown'
import { hatch } from 'ldrs'
hatch.register()
@@ -166,7 +214,7 @@ export default {
const data = await res.json()
hotPosts.value = data.map(p => ({
icon: 'fas fa-book',
- content: p.title
+ post: p
}))
}
@@ -175,7 +223,7 @@ export default {
const data = await res.json()
hotReplies.value = data.map(c => ({
icon: 'fas fa-comment',
- content: c.content
+ comment: c
}))
}
@@ -207,7 +255,7 @@ export default {
}
onMounted(fetchData)
- return { user, hotPosts, hotReplies, timelineItems, isLoading, selectedTab, formatDate }
+ return { user, hotPosts, hotReplies, timelineItems, isLoading, selectedTab, formatDate, stripMarkdown }
}
}
@@ -343,6 +391,12 @@ export default {
margin-top: 5px;
}
+.timeline-snippet {
+ font-size: 14px;
+ color: #666;
+ margin-top: 5px;
+}
+
.timeline-link {
font-weight: bold;
color: var(--primary-color);