<template>
  <iframe :src="url" class="ele-admin-iframe"></iframe>
</template>

<script lang="ts" setup>
  import { ref, watch, unref } from 'vue';
  import { useRouter } from 'vue-router';
  import { setPageTab } from '@/utils/page-tab-util';

  const { currentRoute } = useRouter();
  const url = ref<any>('');

  watch(
    currentRoute,
    (route) => {
      const { fullPath, query } = unref(route);
      url.value = query.url;
      setPageTab({
        fullPath: fullPath,
        title: query.title || '无标题'
      });
    },
    { immediate: true }
  );
</script>
