cmsinfo.vue 1023 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="container">
  3. <!-- <uni-title type="h1" align="center" :title="info.title || info.noticeTitle"></uni-title>
  4. <text class="time">创建时间:{{ info.createTime }}</text> -->
  5. <rich-text image-menu-prevent="true" :nodes="info.content || info.noticeContent" class="content"></rich-text>
  6. <!-- <view class="content" v-html="info.content || info.noticeContent"> -->
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import request from '../../api/cms.js';
  12. import requestNotice from '../../api/system.js';
  13. export default {
  14. onLoad: function (option) {
  15. this.id = option.id;
  16. },
  17. data() {
  18. return {
  19. id: '',
  20. info: null,
  21. }
  22. },
  23. async mounted() {
  24. const res = await request.getArticleDetail({ id: this.id });
  25. this.info = res.data;
  26. await request.addBlogViews({ id: this.id });
  27. },
  28. methods: {}
  29. }
  30. </script>
  31. <style>
  32. .time {
  33. width: 100%;
  34. text-align: center;
  35. display: block;
  36. font-size: 12px;
  37. }
  38. .content {
  39. display: block;
  40. width: 90%;
  41. margin: 10px auto;
  42. }
  43. </style>