index.vue 667 B

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