<script setup>// Here is cachingconst url = '/api/tipologiche/tematiche_secondarie'const options = useCachedData().useFetchOptions({ url })const { data: tematiche } = useFetch<JsonLdCollection<ITipologica>>('/api/tipologiche/tematiche_secondarie', options)const rows = [...]</script><template> <table> <tbody> <tr v-for="row in rows"> <child-component :row /> </tr> </tbody> </table></template>
<script setup lang="ts"> const props = defineProps<{row: any}>() // making api call every time it is instantiated const url = '/api/tipologiche/tematiche_secondarie' const options = useCachedData().useFetchOptions({ url }) const { data: tematiche } = useFetch<JsonLdCollection<ITipologica>>('/api/tipologiche/tematiche_secondarie', options)</script> <template> {{tematiche.includes(row) ? 'yes' : 'no'}}</template>