fix: resolve readonly array type issue in Navigation.vue
Cast readonly project arrays from Pinia store to mutable IProject[] type. The arrays are not actually mutated by the component, so the cast is safe. Fixes TypeScript errors on lines 86, 97, 105 where readonly arrays were incompatible with ProjectsNavigation component props. Related to issue #28 from TYPECHECK_ISSUES.md
This commit is contained in:
parent
4cd53c204d
commit
f67af55204
|
|
@ -126,13 +126,15 @@ import Loading from '@/components/misc/Loading.vue'
|
|||
import {useBaseStore} from '@/stores/base'
|
||||
import {useProjectStore} from '@/stores/projects'
|
||||
import ProjectsNavigation from '@/components/home/ProjectsNavigation.vue'
|
||||
import type {IProject} from '@/modelTypes/IProject'
|
||||
|
||||
const baseStore = useBaseStore()
|
||||
const projectStore = useProjectStore()
|
||||
|
||||
const projects = computed(() => projectStore.notArchivedRootProjects)
|
||||
const favoriteProjects = computed(() => projectStore.favoriteProjects)
|
||||
const savedFilterProjects = computed(() => projectStore.savedFilterProjects)
|
||||
// Cast readonly arrays to mutable type - the arrays are not actually mutated by the component
|
||||
const projects = computed(() => projectStore.notArchivedRootProjects as IProject[])
|
||||
const favoriteProjects = computed(() => projectStore.favoriteProjects as IProject[])
|
||||
const savedFilterProjects = computed(() => projectStore.savedFilterProjects as IProject[])
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
Loading…
Reference in New Issue