<script setup>
import { ref } from 'vue';
import { useRouter, useRoute } from 'vue-router'
const router = useRouter()
const route = useRoute()
// console.log('route :>> ', route);
const options = route.matched.at(-2).children.map(({ name, meta: { title } }) => ({ name, title }))
// console.log('options :>> ', options);
// #region (props)
//
// #endregion

function handleTabChange(name) {
  router.push({ name })
}

const activeName = ref(route.name)
</script>

<template>
  <div class="w-full h-full">
    <div class="card mb-2">
      <el-tabs v-model="activeName" @tab-change="handleTabChange">
        <!-- <el-tab-pane label="待审核" name="-SHGL-JGSQ-DSH"></el-tab-pane>
        <el-tab-pane label="已通过" name="-SHGL-JGSQ-YTG"></el-tab-pane>
        <el-tab-pane label="未通过" name="-SHGL-JGSQ-WTG"></el-tab-pane> -->
        <el-tab-pane v-for="({name,title}) in options" :label="title" :name="name"></el-tab-pane>
      </el-tabs>
    </div>

    <router-view />
  </div>
</template>
