vue-generators / vue-form-generator

:clipboard: A schema-based form generator component for Vue.js
MIT License
2.99k stars 532 forks source link

Spectrum component getting reused #628

Open DelfsEngineering opened 5 years ago

DelfsEngineering commented 5 years ago

In a use case where there are several instances of VFG, I am seeing the spectrum element getting reused. An example would be an accordion where you have multiple instances of VFG for various contacts.

In this example you can see the name field is mapping correctly but the spectrum element does not and only the first myArray is getting updated. I have tried adding a unique id key but I suspect Vue needs a unique key property set. https://jsfiddle.net/s8vqmw0L/2/

DelfsEngineering commented 5 years ago

This also appears to be the case with the rangeSlider element too. @zoul0813 @icebob Any thoughts on this?

higginsd-la commented 5 years ago

@delfsengineering sorry, I haven’t really touched the project in months. Started a new job and haven’t used Vue or VFG for it (yet).

JianChuanting commented 4 years ago

in spectrum case, schema object modified by first spectrum field instance, onchange function added to schema object, and second field instance use the first instance's onchange callback. DO NOT USE SAME SCHEMA OBJECT !

JianChuanting commented 4 years ago

in spectrum case, schema object modified by first spectrum field instance, onchange function added to schema object, and second field instance use the first instance's onchange callback. DO NOT USE SAME SCHEMA OBJECT !