useForm
- Expose original data
#1944
ImSeaWorld
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working in Vue3 and have been using Inertia for the last 2+ years. So far, I've added band-aid solutions to the problem. The only way to access the original data is to reset the form.
I propose we should have access to the original data, unmodified. My current solution is to stuff the original data on fetch with a "form" key where I use
useForm
, storing the same(but now bigger) object on top of a already big object. Not the most elegant solution when the data already exists in memory(somewhere).This solution would allow for further dynamic use-cases and would certainly help my apps memory footprint.
I can't think of any negative to this solution, someone with deeper knowledge may be able to explain one.
Having a key designated as
original
or something would help tremendously.My Use-case:
I'm doing inline editing, but do not want to have the label update with the form.
I'd much rather do a loop over
store.data
and gather my viewable data understoreData.original.{key}
.Perhaps there's a better solution to this by adding a function to retrieve the original data by key.
Beta Was this translation helpful? Give feedback.
All reactions