I’m using Inertia with VueJS, in the HandleInertiaRequests
I have the variable 'foo'
:
public function share(Request $request): array
{
return [
'foo' => str()->random(1000)
];
}
Exists a way to update this variable in a VueJS without refreshing the view?
<script setup>
const updateFoo = () => {
// do something here
}
</script>
<template>
{{ $page.props.foo }}
<button @click="updateFoo" type="button">update</button>
</template>