<template>
  <div>
    <el-radio-group v-model="tabPosition" style="margin: 5px">
      <el-radio-button label="first">锁柜视图</el-radio-button>
      <el-radio-button label="second">列表视图</el-radio-button>
    </el-radio-group>
    <component :is="currentComponent" :cabinetId="this.cabinetId"/>
  </div>

</template>

<script>

import lookList from "./lookList"
import MapData from "./MapData"

export default {
  name: '',
  components: {
    lookList,
    MapData
  },
  data() {
    return {
      tabPosition: 'first',
      cabinetId:null,
    }
  },
  computed: {
    currentComponent() {
      const components = {
        first: 'MapData',
        second: 'lookList',
      }
      return components[this.tabPosition]
    }
  },
  mounted() {
    this.cabinetId = this.$route.query.cabinetId;
    console.log(this.cabinetId,'this.cabinetId');
  },
  methods: {}
}
</script>

<style scoped>
</style>
