<template>
    <div>
        <!-- 导航栏 -->
        <van-nav-bar  title="问答库详情" left-text="返回" left-arrow @click-left="onClickLeft" />

        <!-- 问答库详情 -->
        <van-cell-group>
            <van-cell title="标题" :value="questDetail?.title || '-'" />
            <van-cell title="问题类型" :value="questDetail?.typeName || '-'" />
            <van-cell title="发布人" :value="questDetail?.creatorName || '-'" />
            <van-cell title="通知时间" :value="questDetail?.releaseTime || '-'" />
            <van-cell title="内容:"/>
        </van-cell-group>
        <div style="margin: 10px; max-width: 100%; word-wrap: break-word; overflow-wrap: break-word;">
            <div v-html="questDetail?.content || '-'"></div>
        </div>


    </div>
</template>

<script lang="ts" setup>
import { getDetail } from '@/api/questionsApi';
import { getPageDataRes } from '@/api/questionsApi/types';
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';

const onClickLeft = () => history.back();

const questDetail = ref<getPageDataRes>()
onLoad(async (option) => {
  if (option && option.id) {
    const { id } = option;
    const { data } = await getDetail(id);
    questDetail.value = data;
  }
})

</script>

<style lang="scss" scoped>

</style>