joaomede / vue3-json-editor

A jsoneditor of vue 3 (next) - (fork vue-json-editor)
ISC License
45 stars 29 forks source link

Multiple json editors in same page are rendered in the same wrapper div #14

Closed xys777 closed 2 years ago

xys777 commented 2 years ago

// add a id to identify the different components can fix this issue

const uid = getCurrentInstance().uid;

state.editor = new JsonEditor( document.querySelector('.jsoneditor-vue-' + uid), options, state.json )

<div class={'jsoneditor-vue-' + uid}>

joaomede commented 2 years ago

Thank you

daidaishuo commented 2 years ago

same question in vue3-json-editor 1.1.3 version , is this bug fixed?

joaomede commented 2 years ago

same question in vue3-json-editor 1.1.3 version , is this bug fixed?

Yes, but not released yet, i Do It today

joaomede commented 2 years ago

@daidaishuo new release https://github.com/joaomede/vue3-json-editor/releases/tag/v1.1.4

gustavorps commented 2 years ago

@joaomede Is the same version at NPM?

joaomede commented 2 years ago

@gustavorps Yes

johanmaes commented 2 years ago

Hi @joaomede, thanks for the work on this package. Is it possible that this fix didn't get deployed in v1.1.4? When I clone and build a local version everything works as expected. But when I use the npm package, multiple editors still end up in the same container div.

joaomede commented 2 years ago

Hey Guy @johanmaes, thanks for your time, I made an update

Fixed: https://github.com/joaomede/vue3-json-editor/commit/2112d928b28268be2412e4f68eb65cd02d09309e NPM: https://www.npmjs.com/package/vue3-json-editor/v/1.1.5