ReportDetail.vue 911 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<template>
  <main>
    <div v-if="isLoading" class="ui vertical segment">
      <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div>
    </div>
    <template v-if="object">

      <div class="ui vertical stripe segment">
        <report-card :obj="object"></report-card>
      </div>
    </template>
  </main>
</template>

<script>
import axios from "axios"

import ReportCard from "@/components/manage/moderation/ReportCard"

export default {
  props: ["id"],
  components: {
    ReportCard,
  },
  data() {
    return {
      isLoading: true,
      object: null,
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      var self = this
      this.isLoading = true
      let url = `manage/moderation/reports/${this.id}/`
      axios.get(url).then(response => {
        self.object = response.data
        self.isLoading = false
      })
    },
  },
}
</script>