copied svelte-json-tree instead of using NPM package

This commit is contained in:
Jan Prochazka
2021-04-05 08:58:35 +02:00
parent 573e404612
commit e3fe5a2beb
18 changed files with 525 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
<script>
import JSONNested from './JSONNested.svelte';
export let key, value, isParentExpanded, isParentArray, nodeType;
export let expanded = false;
$: keys = Object.getOwnPropertyNames(value);
function getValue(key) {
return value[key];
}
</script>
<JSONNested
{key}
{expanded}
{isParentExpanded}
{isParentArray}
{keys}
previewKeys={keys}
{getValue}
label="{nodeType} "
bracketOpen={'{'}
bracketClose={'}'}
/>