首页 > 解决方案 > 我们如何使用 Angular Material 显示侧边导航栏菜单?

问题描述

我想使用 JSON 响应(可以是动态的)显示一个侧导航栏,如下所示:

    [{
     "A": "A-Value",
     "B": [{
          "C": [{
               "D": [{
                    "E": "E-Value",
                    "F": "F-Value",
                    "G": "G-Value",
                    "H": "H-Value"
               }],
              "I": "I-Value",
              "J": "J-Value",
              "K": "K-Value",
              "L": "L-Value"
        }, {
           "D": [{
                "E": "E1-Value",
                "F": "F1-Value",
                "G": "G1-Value",
                "H": "H1-Value"
        }],
        "I": "I1-Value",
        "J": "J1-Value",
        "K": "K1-Value",
        "L": "L1-Value"
    }],
    "L": "L2-Value"
}, {
    "L": "L3-Value"
}, {
    "L": "L4-Value"
}, {
    "L": "L5-Value"
}, {
    "c": [{
        "D": [{
            "E": "E2-Value",
            "F": "F2-Value",
            "G": "G2-Value",
            "H": "H2-Value"
        }],
        "I": "I7-Value",
        "J": "J7-Value",
        "K": "K7-Value",
        "L": "L7-Value"
    }],
    "L": "L6-Value"
   }]
}]

并且上述响应应显示在图片中,如下所示: 在此处输入图像描述

我尝试使用 ng-material-multilevel-menu 但它不起作用,因为它的 JSON 结构格式是固定的?

标签: angularangular-material

解决方案


推荐阅读