导入JSON到xmind

写在前面

这只是一个思路,解决大量树状数据,创建xmind低效问题。 函数可以根据你的实际情况优化

1. 转换json格式

javascript 复制代码
function formatToXimd(atd, str) {
    if (atd) {
        for (let index = 0; index < atd.length; index++) {
            console.log(str + '- ' + atd[index].name)     
            formatToXimd(atd[index].productArr,`${str}\t`)
            formatToXimd(atd[index].children,`${str}\t`)
        }
    }
}
formatToXimd('你的JSON', `\t`)

2. 保存成md格式文件

控制台得到一个Md格式的列表,保存成.md格式文件

3. xmind导入该文件

Xmind导入该文件,选择MarkDown格式。

注意:检查一下MD列表,应该只有一个根元素,如果格式不对,需要手动修改

相关推荐
wtsolutions1 天前
Understanding Excel Data Formats - What Excel to JSON Supports
ui·json·excel
wtsolutions1 天前
Real-World Use Cases - How Organizations Use Excel to JSON
json·github·excel
cab51 天前
MyBatis如何处理数据库中的JSON字段
数据库·json·mybatis
FITA阿泽要努力1 天前
动手体验:5min实现第一个智能体——1
json·api·agent·requests·查询天气·pprint·f-string
wtsolutions1 天前
Using the Excel to JSON API - Programmatic Access for Developers
ui·json·xhtml
石云升1 天前
Claude Code 配置教程:如何通过修改 settings.json 优化 AI 编程体验
人工智能·json
wtsolutions2 天前
MCP Service Integration - Excel to JSON for AI and Automation
人工智能·json·excel
cjp5602 天前
019.C#管道服务,两软件间用json数据交互
开发语言·c#·json
组合缺一2 天前
FastJson2 与 SnackJson4 有什么区别?
java·json·fastjson·snackjson