V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
CupTools
V2EX  ›  问与答

vue.js 里面怎么 build tree?

  •  
  •   CupTools · 2016-02-18 14:26:18 +08:00 · 1654 次点击
    这是一个创建于 3209 天前的主题,其中的信息可能已经有所发展或是发生改变。

    官方的 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": []
              }
            ]
          }
        ]
      }
    ]
    
    2 条回复    2016-02-18 14:54:18 +08:00
    CupTools
        1
    CupTools  
    OP
       2016-02-18 14:53:42 +08:00
    nvm, 找到解决方法了
    SourceMan
        2
    SourceMan  
       2016-02-18 14:54:18 +08:00
    @CupTools 分享下呗?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   6037 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 06:23 · PVG 14:23 · LAX 22:23 · JFK 01:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.