<template>
  <div>
    <List v-if="activeName === 'List'" ref="List" />
    <Add v-if="activeName === 'AddOrEdit'" ref="AddOrEdit" />
    <!-- <Detail v-if="activeName==='Detail'"/>-->
  </div>
</template>

<script>
import List from './components/list.vue'
import Add from './components/addOrEdit.vue'

export default {
  components: {
    List: List,
    Add: Add
    // Detail: Detail
  },
  data() {
    return {
      activeName: 'List',
      id: '',
      tableName: ''
    }
  },
  watch: {
    activeName(val) {
      if (val === 'List') {
        this.$refs.List.getList()
      }
    }
  }
}
</script>

<style scoped>
</style>
