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

<script>
import DataThemeList from './DataThemeList'
import DataThemeAdd from './DataThemeAdd'
import DataThemeEdit from './DataThemeEdit'
import DataThemeDetail from './DataThemeDetail'

export default {
  name: 'DataTheme',
  components: { DataThemeList, DataThemeAdd, DataThemeEdit, DataThemeDetail },
  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>
