MMOframework
Pourquoi l'IA Playground Bibliothèques Développeurs Agence
FR EN
Créer un projet en direct
Index

mmo-json-tree

1 symbole · générée le 30 Nov 2026

element

mmo-json-tree

mmo-json-tree.jhs:1

A JSON value shown as a tree: an object or a list folds (a native <details>), each value coloured by its type, every text a text node -- an answer of an API is never html. The value is set from javascript.

<mmo-json-tree open-depth="2"></mmo-json-tree>
Étend
CustomShadowElement
const tree = MMO.core.dom.createElement('mmo-json-tree'); tree.value = {data: [{id: 1}]};

Index

open-depthhow many levels are open at first (2 by default)
value accessorThe value shown
init()
openAll(open)Open or fold every level.
draw()Draw the tree again from the value.
node(key, value, depth)
scalar(value)

Attributs1

open-depth

mmo-json-tree.jhs

how many levels are open at first (2 by default)

open-depth="2"

Propriétés1

Méthodes5

node(key, value, depth)

mmo-json-tree.jhs:52
node(key, value, depth)
key?stringthe key of the value in its parent, null for the root
value*
depthnumber
retourneNodethe value's line, or its folding block