detail.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div>
  3. <!-- 导航栏 -->
  4. <van-nav-bar title="问答库详情" left-text="返回" left-arrow @click-left="onClickLeft" />
  5. <!-- 问答库详情 -->
  6. <van-cell-group>
  7. <van-cell title="标题" :value="questDetail?.title || '-'" />
  8. <van-cell title="问题类型" :value="questDetail?.typeName || '-'" />
  9. <van-cell title="发布人" :value="questDetail?.creatorName || '-'" />
  10. <van-cell title="通知时间" :value="questDetail?.releaseTime || '-'" />
  11. <van-cell title="内容:"/>
  12. </van-cell-group>
  13. <div style="margin: 10px; max-width: 100%; word-wrap: break-word; overflow-wrap: break-word;">
  14. <div v-html="questDetail?.content || '-'"></div>
  15. </div>
  16. </div>
  17. </template>
  18. <script lang="ts" setup>
  19. import { getDetail } from '@/api/questionsApi';
  20. import { getPageDataRes } from '@/api/questionsApi/types';
  21. import { onLoad } from '@dcloudio/uni-app';
  22. import { ref } from 'vue';
  23. const onClickLeft = () => history.back();
  24. const questDetail = ref<getPageDataRes>()
  25. onLoad(async (option) => {
  26. if (option && option.id) {
  27. const { id } = option;
  28. const { data } = await getDetail(id);
  29. questDetail.value = data;
  30. }
  31. })
  32. </script>
  33. <style lang="scss" scoped>
  34. </style>