detail.vue 766 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view style="padding: 20px; line-height: 32px;">
  3. <view class="tt1">{{notice.title}}</view>
  4. <view class="tt3" style="color: #666;">{{notice.createTime}}</view>
  5. <view class="tt2">
  6. <rich-text :nodes="notice.content | formatRichText"></rich-text>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import {
  12. noticeDetail
  13. } from '@/api/notice.js'
  14. export default {
  15. data() {
  16. return {
  17. noticeId: '',
  18. notice: {}
  19. }
  20. },
  21. onLoad(options){
  22. this.noticeId = options.id
  23. this.fetchNoticeDetail()
  24. },
  25. methods: {
  26. fetchNoticeDetail() {
  27. noticeDetail(this.noticeId).then(data => {
  28. //打印请求返回的数据
  29. this.notice = data
  30. }, error => {
  31. console.log(error);
  32. })
  33. },
  34. }
  35. }
  36. </script>
  37. <style>
  38. </style>