manico / vue-jsoneditor

Vue implementation of JSONEditor
MIT License
17 stars 7 forks source link

JSONEditor can now be used as a controlled component #3

Open josdejong opened 6 years ago

josdejong commented 6 years ago

@manico I think you will like the latest releases of the jsoneditor: since v5.20.1 the editor supports being used a controlled component in a framework like React or Vue. There are two new methods update(json) and updateText(text) for this, and two new callback methods onChangeText and onChangeJSON (checkout the docs for details).

You can find two React examples in the examples folder for inspiration:

https://github.com/josdejong/jsoneditor/tree/master/examples/react_demo https://github.com/josdejong/jsoneditor/tree/master/examples/react_advanced_demo

Would that be interesting for the vue-jsoneditor component as well?

manico commented 6 years ago

Yes. I would like to see PR for this.