cipchk / nz-schema-form

ng-zorro-antd form generation based on JSON-Schema
MIT License
40 stars 14 forks source link

type:object 问题 #40

Closed liweitao92 closed 6 years ago

liweitao92 commented 6 years ago

Bug Report or Feature Request (mark with an x)


[ ] Bug report -> please search issues before submitting
[ X] Feature request
[ ] Documentation issue or request

Reproduction link

image

Steps to reproduce

type:object时 ,表单样式显示异常

"menu": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "title": "菜单"
                }
            }
        },

What is expected?

希望能跟上面的表单布局保持一致

What is actually happening?

显示错位

Environment


ng-alain version: X.Y.Z
Angular version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
cipchk commented 6 years ago

麻烦提供完整的 Schema。

liweitao92 commented 6 years ago
{
    "span_label": 4,
    "span": 8,
    "properties": {
        "email": {
            "type": "string",
            "title": "邮箱",
            "format": "email",
            "placeholder": "请输入邮箱,最多20个字符",
            "maxLength": 20,
            "debug": true
        },
        "name": {
            "type": "string",
            "title": "姓名",
            "placeholder": "请输入姓名",
            "description": "必须大写开头且3个字以上",
            "minLength": 3,
            "debug": true
        },
        "age": {
            "type": "number",
            "title": "年龄"
        },
        "remark": {
            "type": "string",
            "title": "描述"
        },
        "menu": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "title": "菜单"
                }
            }
        },
        "products": {
            "type": "array",
            "title": "产品清单",
            "maxItems": 2,
            "items": {
                "type": "object",
                "properties": {
                    "pn": {
                        "title": "产品名称",
                        "type": "string"
                    },
                    "num": {
                        "title": "件数",
                        "type": "number",
                        "minimum": 1,
                        "maximum": 1000
                    },
                    "price": {
                        "title": "金额",
                        "type": "number"
                    }
                },
                "required": ["pn", "num", "price"]
            }
        }
    },
    "button": {
        "style": { "text-align": "center" },
        "items": [
            {
                "label": "Send",
                "id": "send",
                "submit": true,
                "offset": 4
            },
            {
                "label": "Reset",
                "id": "reset"
            }
        ]
    }
}