HelpDetailPage.vue
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!--
* @Date: 2025-03-24 13:04:31
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-06-11 17:33:45
* @FilePath: /mlaj/src/views/profile/HelpDetailPage.vue
* @Description: 文件描述
-->
<template>
<AppLayout title="帮助详情">
<div class="bg-gradient-to-br from-green-50 via-green-100/30 to-blue-50/30 min-h-screen">
<div class="px-4 py-6">
<FrostedGlass class="rounded-xl overflow-hidden p-4">
<h2 class="text-xl font-semibold text-gray-900 mb-4">{{ helpItem?.post_title }}</h2>
<div class="prose prose-sm max-w-none">
<div class="whitespace-pre-wrap text-gray-600 font-normal text-base" v-html="helpItem?.post_content"></div>
</div>
</FrostedGlass>
</div>
</div>
</AppLayout>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import AppLayout from '@/components/layout/AppLayout.vue';
import FrostedGlass from '@/components/ui/FrostedGlass.vue';
import { useTitle } from '@vueuse/core';
// 导入接口
import { getArticleInfoAPI } from "@/api/help";
const $route = useRoute();
const $router = useRouter();
useTitle($route.meta.title);
const route = useRoute();
const helpItem = ref(null);
onMounted(async() => {
// 从本地存储中获取帮助项数据
const id = route.params.id;
const res = await getArticleInfoAPI({i: id});
if (res.code) {
helpItem.value = res.data;
}
});
</script>