<template>
  <div class="container">
    <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="登录" name="login">
        <login :on-login="onLogin"/>
      </el-tab-pane>
      <el-tab-pane label="注册" name="register">
        <register :on-register="onRegister"/>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
  import Login from '../../components/login'
  import Register from '../../components/register'

  export default {
    name: 'index',
    components: { Register, Login },
    data() {
      return {
        activeName: 'login'
      };
    },
    methods: {
      onLogin(user,password){
        console.info(user,password)

      },
      onRegister(user,password){
        console.info(user,password)
      }
    }
  }
</script>
<style>
  .container {
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
  }
</style>
