NGX-FORMLY-具有多级导航的嵌套表单?

时间:2018-11-10 21:33:26

标签: json angular forms reactive angular-formly

ngx-formly角形窗体具有多步窗体和制表符窗体的示例,但是我不知道如何制作多级(嵌套)窗体。例如,第一级是多步,第二级是选项卡。如果可以通过侧栏多级导航菜单完成操作,那就更好了。这是我的表单模型的样子(为简单起见,仅2级,但可以有更多级)。

是否可以使用自定义导航字段类型或包装器完成?多步骤和选项卡并不是真正的角形式的字段类型或包装器。

{
    "root": {
        "category1": { //<!-- First level navigation -->
            "UserName": "Test1",
            "Address": "110 My street",
            "CreateDate": "2018-09-14T00:00:00"
        },
        "category2": { //<!-- First level navigation -->
            "section1": { //<!-- Second level navigation -->
                "check1": "true",
                "check2": "false",
                "commentlist": {
                    "row": [{
                            "comment": "1.1"
                        },
                        {
                            "comment": "1.2"
                        }
                    ]
                },
                "photolist": {
                    "row": [{
                            "Photo1": "oqpNlRSsfwqqwqwq",
                            "caption1": "Flower",
                            "Photo2": "AnU5HPOP89z9aKKKGI//2Q==",
                            "caption2": "Bird"
                        },
                        {
                            "Photo1": "asasaassasas",
                            "caption1": "Flower",
                            "Photo2": "AnU5HPOP89z9aKKKGI//2Q==",
                            "caption2": "Bird"
                        }
                    ]
                }
            }
        },
        "category3": { //<!-- First level navigation -->
            "section1": { //<!-- Second level navigation -->
                //<!-- fields -->
            },
            "section2": { //<!-- Second level navigation -->
                //<!-- fields -->
            },
            "section3": { //<!-- Second level navigation -->
                //<!-- fields -->
            }
        }
    }
}

0 个答案:

没有答案