<template>
 <n-card title="Token工具">
    <n-tabs type="segment" :value="tabValue" @update:value="handleTabChange">
      <n-tab-pane name="Home" tab="Onedrive" />
    </n-tabs>
    <router-view />
  </n-card>
</template>


<script setup>
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
const route = useRoute()
const tabValue = computed(() => {
  const path = route.path
  if (path.startsWith('/onedrive/callback')) {
    return 'CallBack'
  } else {
    return 'Home' // 默认 fallback
  }
})

function handleTabChange(val) {
  router.push({ name: val })
}
</script>



<style scoped>

</style>
