<template>
  <div>
    <el-card shadow="always" :body-style="{ padding: '20px' }">
      <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handChange">
        <el-tab-pane label="非首充模板" name="nofirstTemplate">
          <nofirstTemplate v-if="activeName == 'nofirstTemplate'"></nofirstTemplate>
        </el-tab-pane>
        <el-tab-pane label="首充模板" name="firstTemplate">
          <firstTemplate v-if="activeName == 'firstTemplate'"></firstTemplate>
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script lang="ts" setup>
import { useRouter, useRoute } from 'vue-router'
import type { TabsPaneContext } from 'element-plus'
import nofirstTemplate from "./tabs/nofirstTemplate/index.vue"
import firstTemplate from "./tabs/firstTemplate/index.vue"
const router = useRouter()
const route = useRoute()
const handChange = (tab: TabsPaneContext, event: Event) => {
  activeName.value = tab
}
const activeName = ref('nofirstTemplate')
onMounted(() => {
  activeName.value = route.query.tab || 'nofirstTemplate'
});
</script>

<style scoped lang="scss"></style>
