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

<script>
import DataContrastList from './DataContrastList'
import DataContrastAdd from './DataContrastAdd'
import DataContrastEdit from './DataContrastEdit'
import DataContrastDetail from './DataContrastDetail'

export default {
  name: 'DataContrast',
  components: { DataContrastList, DataContrastAdd, DataContrastEdit, DataContrastDetail },
  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>
