Closed ajnsn closed 3 years ago
I have the same issue.
For what it's worth, you can access the methods. It uses ref
under the hood so you have to use .value
inside setup()
. eg: form.value.post('/')
That being said, using reactive
is more appropriate for forms.
I was facing the same problem and the docs is not clear about this.
Also face the same issues. Approving #440 would be awesome.
A fix is coming for this in #575. 🙌
Thanks for your efforts here @ajnsn. 💜
I'm seeing exactly the same problem with
@inertiajs/inertia@0.11.0
@inertiajs/inertia-vue3@0.6.0
Edit:
Scratch that. I had a form field called "submit". That was overwriting the form
object's submit
method.
Versions:
@inertiajs/inertia
version: 0.8.2@inertiajs/inertia-vue3
version: 0.3.4Describe the problem:
When using the Vue 3 Composition API with the
@inertiajs/inertia-vue3
form helper, the methods of the form helper (post()
,submit()
etc.) only work when used inside the Options API or the template.When using
setup
to expose your own method, an error is logged to the console, e.g.Steps to reproduce:
Fix
This issue occurs because the export in uses
ref()
instead ofreactive()
. I thinkref()
is more for primitive types.Changing it to
reactive()
should fix this issue: