explorer-app/pages/category/[id].vue

18 lines
487 B
Vue
Raw Normal View History

2023-12-19 18:43:42 +01:00
<script lang="ts" setup>
const dataStore = useData()
const { selectedCategoryId, categories, filteredProjects } = storeToRefs(dataStore)
2023-12-19 18:43:42 +01:00
const route = useRoute()
onMounted(() => {
if (route.params.id)
selectedCategoryId.value = route.params.id as string
})
2024-09-17 08:13:11 +02:00
const group = computed(() => [{ title: categories.value.find(c => c.id === selectedCategoryId.value)?.name || '', projects: filteredProjects.value }])
2023-12-19 18:43:42 +01:00
</script>
<template>
<ProjectGrid :projects="group" />
2023-12-19 18:43:42 +01:00
</template>