0๐
If you are using setup you do like my code for better user formatting
First you cannot access route()
inside a .vue
file it only accessible via .blade
extension.
Second separate your function from your template.
<template>
...
<form @submit.prevent="submit">
...
</form>
...
</template>
<script setup>
import {Link, useForm} from "@inertiajs/inertia-vue3"
const form = useForm({
name: '',
email: '',
password: '',
})
const submit = () => form.post('/store')
</script>
Source:stackexchange.com