[Vuejs]-Vue 3 Composition Api – Find object and render

0👍

Since you are dispatching the company_projects/getProjectList action (which I suppose is responsible for fetching data from the server) directly in the setup, it is very likely that at the moment your component will render for the 1st time, the company_projects/getProjectList getter (and consequently the state.company_projects computed) will return an empty array and thus filtered_projects is undefined (find)

Which means the part of your template which needs filtered_projects to have a value should be protected with v-if

<form class="edit-form" @submit.prevent="submitProject()" v-if="filtered_projects">

Leave a comment