It should be available in form. There is also a form.isDirty()
get the form data object
Am i just blind, or can you not get the form data form an inertia form?
I have a simple form like this
data() {
form: this.$inertia.form({
expenses: [],
partner_expenses: [],
})
}
},
I am wanting to grab that data and check it to see if has changed incase the user clicks away to go elsewhere before saving
I have the code for beforeunload and Inertia.on('before') loaded and working, now I just need to somehow get the data from the form to check to see if it has been updated.
How can I go about doing this?
@nzmattman I wrongly assumed the data was nested like in react. Seems vue isn't nested so it's just form
Don't think isDirty() shows what was changed. But use console.log() to check
It is mentioned at the bottom of this page https://inertiajs.com/forms
Please or to participate in this conversation.