【问题标题】:JSON to side menu generation in angular5 to n levelsJSON 到 angular5 到 n 级别的侧边菜单生成
【发布时间】:2019-06-12 05:47:06
【问题描述】:

我正在尝试构建一个必须动态生成页面侧边菜单的 UI 请找到以下 json 示例

{
  "side-menu 1": {
    "id": "",
    "display-name": "",
    "route-id": "",
    "description": "<reference to md file with contents, images, etc>",
    "sub-menu": [
      {
        "id": "",
        "display-name": "",
        "route-id": "",
        "description": "<reference to md file with contents, images, etc>",
        "sub-menu": [
          {
            "id": "",
            "display-name": "",
            "route-id": "",
            "description": "<reference to md file with contents, images, etc>"
          },

          {
            "id": "",
            "display-name": "",
            "route-id": "",
            "description": "<reference to md file with contents, images, etc>"
          }
        ]
      },
      {
        "id": "",
        "display-name": "",
        "route-id": "",
        "description": "<reference to md file with contents, images, etc>"
      }
    ]
  }

}

我已经尝试使用“ng-material-multilevel-menu”和 2 天,但它有一些依赖问题请告诉我我可以使用哪个插件或方法来实现这一点

请在 Angular 6 中指出一些参考示例来完成这项工作

【问题讨论】:

标签: json angular side-menu


【解决方案1】:

我不知道你是否还在寻找答案。如果是,并且对于新观众,那么我为 Angular 创建了一个插件,它创建了一个多级菜单。现在您也可以将此多级菜单转换为 Accordion,例如 Check this example

这里有一个NPM LinkGithub Link,文档很甜很简单。

以防万一,如果您想查看更多示例,我有一个 demo 给您,这是演示的 Github Repo

如果有些东西对你不起作用,而你仍然想使用这个插件,那么create an issue 在这里我会帮助你。

附:它也适用于 IE11。

谢谢

【讨论】:

    猜你喜欢
    • 2018-09-06
    • 1970-01-01
    • 2019-07-11
    • 1970-01-01
    • 1970-01-01
    • 2018-12-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多