<template>
  <div class="app-container">
    <transition name="el-zoom-in-center">
      <job-list v-if="options.showList" @showCard="showCard"></job-list>
    </transition>
    <transition name="el-zoom-in-top">
      <job-add v-if="options.showAdd" :data="options.data" @showCard="showCard"></job-add>
    </transition>
    <transition name="el-zoom-in-top">
      <job-edit v-if="options.showEdit" :data="options.data" @showCard="showCard"></job-edit>
    </transition>
    <transition name="el-zoom-in-bottom">
      <job-detail v-if="options.showDetail" :data="options.data" @showCard="showCard"></job-detail>
    </transition>
  </div>
</template>

<script>
import JobList from './JobList'
import JobAdd from './JobAdd'
import JobEdit from './JobEdit'
import JobDetail from './JobDetail'

export default {
  name: 'Job',
  components: { JobList, JobAdd, JobEdit, JobDetail },
  data () {
    return {
      options: {
        data: {},
        showList: true,
        showAdd: false,
        showEdit: false,
        showDetail: false
      }
    }
  },
  methods: {
    showCard (data) {
      Object.assign(this.options, data)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
