<template>
  <div v-loading="loading" :style="{ height: height }">
    <iframe
      ref="frameRef"
      :src="src"
      frameborder="0"
      style="width: 100%; height: 100%"
    />
  </div>
</template>

<script>
export default {
  name: "IFrame",
  props: {
    src: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      loading: true,
      height: "",
    };
  },
  mounted() {
    setTimeout(() => {
      this.init();
    }, 300);
  },
  methods: {
    init() {
      this.height = document.documentElement.clientHeight - 94.5 + "px";
      this.loading = false;
    },
  },
};
</script>
