index.vue 652 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div v-loading="loading" :style="'height:' + height">
  3. <iframe
  4. :src="url"
  5. frameborder="no"
  6. style="width: 100%; height: 100%"
  7. scrolling="auto" />
  8. </div>
  9. </template>
  10. <script setup>
  11. const props = defineProps({
  12. src: {
  13. type: String,
  14. required: true
  15. }
  16. })
  17. const height = ref(document.documentElement.clientHeight - 94.5 + "px;")
  18. const loading = ref(true)
  19. const url = computed(() => props.src)
  20. onMounted(() => {
  21. setTimeout(() => {
  22. loading.value = false;
  23. }, 300);
  24. window.onresize = function temp() {
  25. height.value = document.documentElement.clientHeight - 94.5 + "px;";
  26. };
  27. })
  28. </script>