<template>
  <div class="app-container">
    <component
      :is="currentComponent"
      :query-params="currentQueryParams"
      @switch-view="showDetails"
    />
  </div>
</template>

<script>
import EquipmentMainList from './EquipmentMainList.vue'
import EquipmentDetailList from './EquipmentDetailList.vue'
export default {
  components: {
    EquipmentMainList,
    EquipmentDetailList
  },
  data() {
    return {
      isDetails:'0',
    }
  },
  computed: {
    currentComponent() {
      return this.isDetails === '0' ? 'EquipmentMainList' : 'EquipmentDetailList'
    },
    currentQueryParams() {
      return this.isDetails === '0' ? this.queryParams : this.queryParamsDetails
    }
  },

  methods: {
    //展示明细
    showDetails( num){
      this.isDetails = num;
    }
  }
}
</script>

<style scoped lang="scss">

</style>
