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

<script>
import List from './components/list'
import Add from './components/add'
import Edit from './components/edit'
import Info from '../archive/components/info'

export default {
  components: {
    List,
    Add,
    Edit,
    Info
  },
  data() {
    return {
      activeName: 'List',
      INSPECTION_ID: ''
    }
  },
  watch: {
    activeName(newValue, oldValue) {
      if (newValue == 'List') {
        this.$refs.list.getQuery()
      }
    }
  }
}
</script>

<style lang="sss" scoped></style>
