fix: fundings

This commit is contained in:
DomWane 2024-10-01 13:52:19 +02:00
parent 45b00432e9
commit caf8f42620

View file

@ -11,7 +11,7 @@ type Fundings = {
} }
function useFundings(project?: Partial<Project>) { function useFundings(project?: Partial<Project>) {
const fundings = ref<Fundings[]>(Array.isArray(project?.funding) ? project?.funding as unknown as Fundings[] : [project?.funding as unknown as Fundings]) const fundings = ref(Array.isArray(project?.funding) ? project.funding : (project?.funding ? [project.funding] : []))
const newFunding = reactive<Fundings>({ const newFunding = reactive<Fundings>({
name: '', name: '',
link: '', link: '',
@ -58,7 +58,7 @@ defineExpose({
/> />
<ProjectCreateComponentsItem <ProjectCreateComponentsItem
v-for="funding in fundings" v-for="funding in fundings"
:key="funding.name" :key="funding?.name"
@remove="() => removeFunding(fundings?.indexOf(funding))" @remove="() => removeFunding(fundings?.indexOf(funding))"
> >
<template #label> <template #label>
@ -69,13 +69,13 @@ defineExpose({
<span <span
class="text-app-black text-14px font-700" class="text-app-black text-14px font-700"
lg="text-16px" lg="text-16px"
> {{ funding.name }} > {{ funding?.name }}
</span> </span>
</div> </div>
</template> </template>
<template #desc> <template #desc>
<NuxtLink <NuxtLink
:to="funding.link" :to="funding?.link"
hover:text-app-black hover:text-app-black
class="text-app-black/50 text-16px hidden" class="text-app-black/50 text-16px hidden"
lg="block" lg="block"