<template>
  <div>
    <List v-show="activeName=='List'" ref="list" />
    <Edit v-if="activeName=='Edit'" />
  </div>
</template>

<script>
import List from './components/list'
import Edit from './components/edit'
export default {
  components: {
    List: List,
    Edit: Edit
  },
  data() {
    return {
      activeName: 'List'
    }
  },
  watch: {
    activeName(val) {
      if (val == 'List') {
        this.$refs.list.getQuery()
      }
    }
  }
}
</script>

<style scoped>
</style>
