treeview的数据格式问题

怎么用递归封装下面的数据格式 

{

    text: "Parent 1",

    nodes: [

      {

        text: "Child 1",

        nodes: [

          {

            text: "Grandchild 1"

          },

          {

            text: "Grandchild 2"

          }

        ]

      },

      {

        text: "Child 2",

        nodes: [

          {

            text: "Grandchild 1"

          },

          {

            text: "Grandchild 2"

          }

        ]

      }

    ]

  },

  {

    text: "Parent 2"

  },

  {

    text: "Parent 3"

  },

  {

    text: "Parent 4"

  },

  {

    text: "Parent 5"

  }

];


慕斯卡6635957
浏览 1327回答 0
0回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java