<template>
  <div name="modulePreview" :style="{ height: contentHeight }">
    <module-preview :data="moduleData" style="height: 100%"></module-preview>
  </div>
</template>

<script>
  import { getSysModule } from '@/api/sysModule.js'
  import ModulePreview from './modulePreview.vue'
  export default {
    props: {
      id: {
        type: String,
        default: '',
      },
    },
    computed: {
      contentHeight() {
        return document.documentElement.clientHeight + 'px'
      },
    },
    data() {
      return {
        moduleData: {},
      }
    },
    components: {
      ModulePreview,
    },
    created() {
      getSysModule(this.id).then((result) => {
        if (result.state) {
          this.moduleData = result.value
        }
      })
    },
  }
</script>

<style lang="scss" scoped></style>
