explorer-app/pages/category/[id].vue
2024-09-12 11:56:16 +02:00

17 lines
465 B
Vue

<script lang="ts" setup>
const dataStore = useData()
const { selectedCategoryId, categories, filteredProjects } = storeToRefs(dataStore)
const route = useRoute()
onMounted(() => {
if (route.params.id)
selectedCategoryId.value = route.params.id as string
})
const group = [{ title: categories.value.find(c => c.id === selectedCategoryId.value)!.name, projects: filteredProjects.value }]
</script>
<template>
<ProjectGrid :projects="group" />
</template>