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

<script>
import IndexList from './components/List'
import CarView from "./components/car_view";
import Record from "./components/record";
export default {
  components: {
    CarView: CarView,
    IndexList: IndexList,
    Record: Record
  },
  data() {
    return {
      activeName: 'List'
    }
  },
  watch: {
    activeName(newValue, oldValue) {
      if (newValue == 'List') {
        this.$refs.list.getQuery()
      }
    }
  }
}
</script>

<style scoped>

</style>
