bestkolobok / vue3-jsoneditor

https://bestkolobok.github.io/vue3-jsoneditor/
MIT License
52 stars 9 forks source link

:json prop does not support Array type #7

Closed vivid-lamp closed 1 year ago

vivid-lamp commented 1 year ago

When I pass array [1,2,3] to :json prop, it parse this array incorrect.

image

image

bestkolobok commented 1 year ago

Hi!

Thanks for finding this bug. Already fixed it and updated the basic package https://github.com/josdejong/svelte-jsoneditor with the addition of new functionality.

Also, note that:

If you want use v-model (not v-model:json or v-model:text) then the type of data depends on the mode of the editor. If mode="tree", then the data type in the model is JSON value, if mode="text", then the data type is JSON string. Please be aware that in text mode v-model can contain invalid JSON: whilst typing in text mode, a JSON document will be temporarily invalid, like when the user is typing a new string.

It is more clear to use v-model:json for tree mode and v-model:text for text mode.

bestkolobok commented 1 year ago

Hi, @vivid-lamp!

If your question is resolved, please close this issue