BuildingCapture.vue 1.59 KB
Newer Older
abergavenny's avatar
abergavenny committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<script setup>
import { ref } from 'vue'

import TabComponent from '@/components/TabComponent.vue'
import CharacteristicsForm from '@/components/forms/CharacteristicsForm.vue'
import HeatingForm from '@/components/forms/HeatingForm.vue'
import FacadeForm from '@/components/forms/FacadeForm.vue'
import RoofForm from '@/components/forms/RoofForm.vue'
import BasementForm from '@/components/forms/BasementForm.vue'

const activeTab = ref('characteristics')

function setActiveTab(value) {
  activeTab.value = value
}
</script>

<template>
  <div class="building-capture">
    <TabComponent :active="activeTab" :tabs="[
      { key: 'characteristics', value: 'characteristics', name: 'Allgemein' },
      { key: 'heating', value: 'heating', name: 'Heizung' },
      { key: 'facade', value: 'facade', name: 'Fassade' },
      { key: 'roof', value: 'roof', name: 'Dach' },
      { key: 'basement', value: 'basement', name: 'Keller' }
    ]" @on-tab-select="setActiveTab" />
    <div class="building-capture__content">
      <CharacteristicsForm v-if="activeTab === 'characteristics'" />
      <HeatingForm v-else-if="activeTab === 'heating'" />
      <FacadeForm v-else-if="activeTab === 'facade'" />
      <RoofForm v-else-if="activeTab === 'roof'" />
      <BasementForm v-else-if="activeTab === 'basement'" />
    </div>
  </div>
</template>

<style scoped>
.building-capture {
  display: flex;
  flex-direction: column;
}

@media (min-width: 48em) {
  .building-capture {
    overflow: hidden;
    height: 100%;
  }
}

.building-capture__content {
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}
</style>