You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a complex form with realtime preview on the left. The real data is stored model, with two view-models two-way binded to the model. useForm only support deep copy data from initialValue.
Describe the solution you'd like
Allow two-way binding from external value.
constmodel=reactive({realValue: 'opt1-opt2'});constformViewModel=reactive({field1: computed({get(){returnmodel.realValue.split('-')[0];},set(value){model.realValue=value+'-'+model.realValue.split('-')[1];},}),field2: computed({get(){returnmodel.realValue.split('-')[1];},set(value){model.realValue=model.realValue.split('-')[1]+'-'+value;},}),});constform=useForm({values: formViewModel});// all edits are synced to `model`
Describe alternatives you've considered
All these model, view-models are in different shape, so it is really a bad idea to use data from the form for preview
The text was updated successfully, but these errors were encountered:
The real scenario is more complex, the model is ouside of vue and 'computed' to another framework data, for example, some chart library. There could be multiple frameworks constructs the preview
Is your feature request related to a problem? Please describe.
I have a complex form with realtime preview on the left. The real data is stored model, with two view-models two-way binded to the model.
useForm
only support deep copy data frominitialValue
.Describe the solution you'd like
Allow two-way binding from external value.
Describe alternatives you've considered
All these model, view-models are in different shape, so it is really a bad idea to use data from the form for preview
The text was updated successfully, but these errors were encountered: