index.vue 634 B

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