<template>
  <div class="app-container">
    <transition name="el-zoom-in-center">
      <user-list v-if="isShowList" @showForm="showForm"></user-list>
    </transition>
    <transition name="el-zoom-in-top">
      <user-form v-if="isShowForm" :id="id" @showList="showList"></user-form>
    </transition>
  </div>
</template>

<script>
import UserList from './UserList'
import UserForm from './UserForm'

export default {
  name: 'User',
  components: { UserList, UserForm },
  data () {
    return {
      id: undefined,
      isShowList: true,
      isShowForm: false
    }
  },
  methods: {
    showList () {
      this.isShowList = true
      this.isShowForm = false
    },
    showForm (id) {
      this.id = id
      this.isShowList = false
      this.isShowForm = true
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
