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

<script>
import RoleList from './RoleList'
import RoleForm from './RoleForm'

export default {
  name: 'Role',
  components: { RoleList, RoleForm },
  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>
