<template>
  <div class="app-container">
    <transition name="el-zoom-in-center">
      <menu-list v-if="isShowList" @showForm="showForm"></menu-list>
    </transition>
    <transition name="el-zoom-in-top">
      <menu-form v-if="isShowForm" :id="id" @showList="showList"></menu-form>
    </transition>
  </div>
</template>

<script>
import MenuList from './MenuList'
import MenuForm from './MenuForm'

export default {
  name: 'Menu',
  components: { MenuList, MenuForm },
  data () {
    return {
      id: undefined,
      isShowList: true,
      isShowForm: false
    }
  },
  methods: {
    showList () {
      this.isShowList = true
      this.isShowForm = false
    },
    showForm (id) {
      this.id = id
      this.isShowList = false
      this.isShowForm = true
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
