27 lines
600 B
Vue
27 lines
600 B
Vue
<template>
|
|
<StandardLayout>
|
|
<RouterView />
|
|
</StandardLayout>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import { watch } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
import StandardLayout from '../../components/StandardLayout.vue';
|
|
import { useBuildingStore } from '../../store/building.store';
|
|
|
|
const route = useRoute();
|
|
const buildingStore = useBuildingStore();
|
|
|
|
const getBuilding = async (id: number) => {
|
|
try {
|
|
await buildingStore.getBuilding(id);
|
|
} catch (e) {}
|
|
};
|
|
|
|
watch(
|
|
() => route.params.id,
|
|
() => getBuilding(Number(route.params.id)),
|
|
{ immediate: true }
|
|
);
|
|
</script>
|