[Vuejs]-InertiaJS Request updated data from server while preserving state

0👍

After some messing with configuration options, I found a way to update data while preserving state. Simply use the onSuccess option while preserving state:

...
props: ['data'],
...

this.$inertia.visit(url, {
    preserveState: true,
    onSuccess: page => {
        this.data = page.props.data;
    }
})

Leave a comment