<template>
  <div class="app-container">
    <transition name="el-zoom-in-center">
      <post-list v-if="isShowList" @showCard="showCard"></post-list>
    </transition>
    <transition name="el-zoom-in-top">
      <post-add v-if="isShowAdd" @showCard="showCard"></post-add>
    </transition>
  </div>
</template>

<script>
import PostList from './PostList'
import PostAdd from './PostAdd'

export default {
  name: 'Post',
  components: { PostList, PostAdd },
  data () {
    return {
      id: undefined,
      isShowList: true,
      isShowAdd: false,
      isShowEdit: false,
      isShowDetail: false
    }
  },
  methods: {
    showCard (data) {
      console.log('data:' + JSON.stringify(data))
      // id: undefined
      // data:{"isShowList":false,"isShowAdd":true,"isShowEdit":false,"isShowDetail":false}
      // data:{"id":"1214825605782228993","isShowList":false,"isShowAdd":false,"isShowEdit":true,"isShowDetail":false}
      // this.isShowList = true
      // this.isShowAdd = false
      // this.isShowEdit = false
      // this.isShowDetail = false
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
