<template>
  <div v-if="showFrame" style="height: calc(100vh - 60px)">
    <FramePage :frameSrc="frameSrc.replace('#{token}', userStore.getToken)" />
  </div>
</template>
<script lang="ts" setup>
  import FramePage from './components/FramePage.vue';
  import { useUserStore } from '/@/store/modules/user';
  import { useRoute } from 'vue-router';
  import { onMounted, ref } from 'vue';
  const route = useRoute();

  const userStore = useUserStore();
  const frameSrc = ref('') as any;
  const showFrame = ref(false);

  onMounted(() => {
    if (route && route.meta && route.meta.iframeSrc) {
      frameSrc.value = route.meta.iframeSrc;
      showFrame.value = true;
    }
  });
</script>
