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

<script>
import CheckRuleList from './CheckContentRuleList'
import CheckRuleAdd from './CheckContentRuleAdd'
import CheckRuleEdit from './CheckContentRuleEdit'
import CheckRuleDetail from './CheckContentRuleDetail'

export default {
  name: 'CheckContentRule',
  components: { CheckRuleList, CheckRuleAdd, CheckRuleEdit, CheckRuleDetail },
  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>
