nidus-sync/ts/rmo/view/district/Nuisance.vue

30 lines
836 B
Vue
Raw Normal View History

<style scoped></style>
<template>
<Nuisance :slug="slug">
<template #header>
<!-- Introduction Section -->
<HeaderDistrict :district="district" />
</template>
</Nuisance>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { computedAsync } from "@vueuse/core";
import Nuisance from "@/rmo/content/Nuisance.vue";
import type { District } from "@/rmo/type";
import { useDistrictStore } from "@/rmo/store/district";
import HeaderDistrict from "@/components/HeaderDistrict.vue";
interface Props {
slug: string;
}
const props = defineProps<Props>();
const districtStore = useDistrictStore();
const district = computedAsync(async (): Promise<District | undefined> => {
const districts = await districtStore.get();
return districts.find((district: District) => district.slug == props.slug);
});
</script>