newsDetail.vue 837 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <view class="container" v-if="info !== null">
  3. <!-- 标题区域 -->
  4. <view class="title">{{ info.title }}</view>
  5. <!-- 发布时间区域 -->
  6. <view class="time">{{ info.update_time }}</view>
  7. <!-- 内容区域 -->
  8. <mp-html :content="info.content" />
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. info: null
  16. }
  17. },
  18. onLoad(options) {
  19. this.info = JSON.parse(decodeURIComponent(options.info))
  20. // this.info.content = this.info.content.replace(/data-src/g, 'src')
  21. }
  22. }
  23. </script>
  24. <style lang="scss" scoped>
  25. .container {
  26. padding: 0 30rpx;
  27. min-height: 100vh;
  28. background-color: #fff;
  29. .title {
  30. padding-top: 30rpx;
  31. text-align: center;
  32. font-size: 32rpx;
  33. font-weight: bold;
  34. }
  35. .time {
  36. margin-top: 20rpx;
  37. text-align: center;
  38. color: #666666;
  39. font-size: 24rpx;
  40. }
  41. }
  42. </style>