<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="recharge">
          <rechargeSettle v-if="activeName == 'recharge'"></rechargeSettle>
        </el-tab-pane>
        <el-tab-pane label="结算规则" name="settlementRules">
          <rechargeRules v-if="activeName == 'settlementRules'"></rechargeRules>
        </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 rechargeSettle from "./tabs/rechargeSettle/index.vue"
import rechargeRules from "./tabs/rechargeRules/index.vue"
const router = useRouter()
const route = useRoute()
const handChange = (tab: TabsPaneContext, event: Event) => {
  activeName.value = tab
}
const activeName = ref('recharge')
onMounted(() => {
  activeName.value = route.query.tab || 'recharge'
});
</script>

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