vue.js 里面怎么 build tree?

2016-02-18 14:26:18 +08:00
 CupTools

官方的 Example 用的是 v-repeat ,在最新的版本已经是 deprecated 了。用 v-for 的话怎么树视图?

[
  {
    "description": "No longer needed",
    "displayName": "Archive",
    "folderId": "85c6bd6a-6dc1-4e8f-8db2-09d29cb36be5",
    "mutable": false,
    "parent": null,
    "child": []
  },
  {
    "description": "Main Inbox",
    "displayName": "Inbox",
    "folderId": "0ccc3ae5-6d26-45a1-96c1-0d7f02bb8f36",
    "mutable": false,
    "parent": null,
    "child": [
      {
        "description": "Work related emails",
        "displayName": "Work",
        "folderId": "b55fd3d0-d023-4427-b8d4-a65c8f522802",
        "mutable": false,
        "parent": "0ccc3ae5-6d26-45a1-96c1-0d7f02bb8f36",
        "child": [
          {
            "description": "About serve",
            "displayName": "serve",
            "folderId": "408d26f7-c1dc-419f-9688-ce1401db4bef",
            "mutable": false,
            "parent": "b55fd3d0-d023-4427-b8d4-a65c8f522802",
            "child": []
          }
        ]
      }
    ]
  }
]
1651 次点击
所在节点    问与答
2 条回复
CupTools
2016-02-18 14:53:42 +08:00
nvm, 找到解决方法了
SourceMan
2016-02-18 14:54:18 +08:00
@CupTools 分享下呗?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/257346

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX