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

<script>
import DeptList from './DeptList'
import DeptForm from './DeptForm'

export default {
  name: 'Dept',
  components: { DeptList, DeptForm },
  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>
