<script setup lang='ts'>
const tabs = [
  { title: '错题列表', path: 'admin_index' },
  { title: '错题审核', path: 'admin_indey' },
]

const route = useRoute()
const active = ref(route.name)

function onClickLeft() {
  history.back()
}
</script>

<template>
  <div class="w-full h-screen flex flex-col">
    <div class="w-full sticky top-0 z-100">
      <slot name="nav">
        <van-nav-bar title="错题分析" left-text="返回" left-arrow @click-left="onClickLeft" />
      </slot>

      <van-tabs v-model:active="active" class="sticky">
        <van-tab v-for="tab in tabs" :title="tab.title" :name="tab.path" :to="{ name: tab.path }"></van-tab>
      </van-tabs>
    </div>

    <slot :key="active" class="flex-auto"></slot>
  </div>
</template>
