简体   繁体   中英

Transforming a tree back to JSON using tree-model-js

Is there perhaps a way in which you can convert a TreeModel to a JSON string. That way it can be stored and then later recreated using tree.parse() ?

Currently when attempting JSON.stringify(root) it gives an obvious error about cyclic references (because children contain parents and parents contain children).

请改用JSON.stringify(root.model)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM