<script setup>
// import HelloWorld from './components/HelloWorld.vue';
import { ref } from 'vue';
import LoginComp from './components/login_comp.vue'
import RegisterComp from './components/register_comp.vue'

const tab = ref(null)

</script>


<template>
  <v-app class="h-100 w-100">
    <v-main class="h-100 w-100 d-flex justify-center align-center">
      <v-card class="main-card ">
        <div class="card-title bg-indigo text-h5 text-center pa-5">
          南高乒乓球俱乐部
        </div>

        <v-tabs
            v-model="tab"
            bg-color="indigo"
            grow
          >
            <v-tab value="login">
              登录
            </v-tab>
            <v-tab value="register">
              注册
            </v-tab>
          </v-tabs>
          <v-window v-model="tab">
            <v-window-item 
            :key="1"
            :value="'login'">
              <LoginComp></LoginComp>
            </v-window-item>
            <v-window-item 
            :key="2"
            :value="'register'">
              <RegisterComp></RegisterComp>
            </v-window-item>
          </v-window>
      </v-card>
    </v-main>
  </v-app>
</template>

<script>
import { ref } from 'vue';
import { reactive } from 'vue';
import axios from 'axios';

axios.get('/api/currentUser',)
  .then(function(response){
    const data = response.data;
    if (data.status === "SUCCESS"){
      window.location.href = '/main.html';
    }
  })
</script>

<style>
.main-card{
  width: 300px;
  /* height: 500px; */
}



</style>
