<template>
  <div class="app-content" style="height:75vh;overflow:auto;">
    <a-spin :spinning="loading" style="width:100%;height:100%;">
      <div v-html="formData.content"></div>
    </a-spin>
  </div>
</template>

<script>
export default {
  name: "msg",
  components: {},
  props: {
    value: {
      type: String,
      default: () => {
        return null;
      },
    },
  },
  data () {
    return {
      formData: { title: null, content: null },
      loading: false,
    }
  },
  created () {
    this.getById()
  },
  computed: {
  },
  methods: {
    getById () {
      if (!!this.value) {
        this.loading = true
        this.$api.notice.getById({ id: this.value }).then(({ data = {} }) => {
          if (data) {
            this.formData = data
          }
          this.loading = false
        }).catch(() => {
          this.loading = false
        })
      }
    },
  },
};
</script>
<style scoped lang="less">
</style>
