news_detail.vue 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="container">
  3. <!-- 标题区域 -->
  4. <view class="title">{{ info.theme }}</view>
  5. <!-- 时间区域 -->
  6. <view class="time">{{ dayjs(info.createTime).format('YYYY-MM-DD HH:mm:ss') }}</view>
  7. <!-- 内容区域 -->
  8. <view class="content">
  9. <uv-parse :content="info.content" container-style="white-space:pre-wrap"></uv-parse>
  10. </view>
  11. </view>
  12. </template>
  13. <script setup>
  14. import { onLoad } from '@dcloudio/uni-app'
  15. import { ref } from 'vue'
  16. import dayjs from 'dayjs'
  17. // 新闻详情信息
  18. const info = ref({})
  19. onLoad((options) => {
  20. if (options.info) {
  21. info.value = JSON.parse(decodeURIComponent(options.info))
  22. // console.log(info.value)
  23. // console.log(info.value.content)
  24. }
  25. })
  26. </script>
  27. <style lang="scss" scoped>
  28. .container {
  29. padding: 20rpx 18rpx;
  30. min-height: 100vh;
  31. .title {
  32. font-size: 32rpx;
  33. font-weight: bold;
  34. }
  35. .time {
  36. margin-top: 15rpx;
  37. font-size: 24rpx;
  38. color: #808080;
  39. }
  40. .content {
  41. margin-top: 20rpx;
  42. }
  43. }
  44. </style>