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

18 lines
465 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
})
const group = [{ 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>