object-visualizer icon indicating copy to clipboard operation
object-visualizer copied to clipboard

Web Component / Custom Element

Open schirrel opened this issue 3 years ago • 2 comments

Wouldn't it be nice to create a component to just use data as a prop? And there no need to use it in the js. If you agree i could do that =)

schirrel avatar Jul 17 '20 17:07 schirrel

Thanks. To add custom element would be a key feature, but there should remain the mount method, due to somebody would want to mount to existing node or do something dynamically.

soc221b avatar Jul 18 '20 03:07 soc221b

In the meantime, maybe add to the README.md file a directive workaround. Something like:

import {mount} from 'object-visualizer'
...
app.directive('json-tree', (el, bind) => {
    mount(bind.value, el)
})

And to use:

<div v-json-tree="OBJECT"></div>

tbarkai avatar May 23 '22 09:05 tbarkai