Nov 28, 2024
0
Level 1
Partial reload not updating the props of the component
When I call router.reload({ only: ['myData'] }) on my component I can see that the HTTP request is made and the data returned is new (updated) but the props of my component are not changed therefor "nothing happens", do I need to instruct inertia to change the prop of my page so I can see the data being updated?
import { router } from '@inertiajs/vue3'
<script lang="ts">
const props = defineProps<{ reports: string[] }>()
const refreshReport = () => router.reload({ only : ['reports'] })
</script>
<template>
<Button @click="refreshReport">Refresh report</Button>
<AnotherComponent :report="props.report" />
</template>
Please or to participate in this conversation.