refactor: 将解决方案页文章提取为单独的组件

This commit is contained in:
2025-10-29 17:03:28 +08:00
parent 5f78c888a2
commit 9982481c83
2 changed files with 55 additions and 53 deletions

View File

@ -0,0 +1,54 @@
<template>
<article class="solution-defail">
<header class="solution-header">
<h1 class="solution-title">{{ solution.title }}</h1>
<dl class="solution-meta">
<dt class="visually-hidden">CreatedAt:</dt>
<dd class="solution-date">
{{ new Date(solution.createAt).toLocaleDateString() }}
</dd>
</dl>
<p class="solution-summary">{{ solution.summary }}</p>
</header>
<section class="solution-content">
<markdown-renderer :content="solution?.content || ''" />
</section>
</article>
</template>
<script setup lang="ts">
defineProps({
solution: {
type: Object as PropType<SolutionView>,
default: null,
},
});
</script>
<style scoped>
.solution-title {
font-size: 2rem;
font-weight: bold;
color: var(--el-color-primary);
text-align: center;
}
.solution-meta {
display: flex;
justify-content: center;
gap: 1rem;
margin-bottom: 0.5rem;
font-size: 0.8rem;
color: var(--el-text-color-secondary);
}
.solution-summary {
font-size: 0.8rem;
color: var(--el-text-color-secondary);
text-align: center;
}
.solution-content {
margin-top: 1rem;
}
</style>