Skip to content

在oneOf中 一种type为string 一种type为object,默认数据为object,在切换时,会报错,TypeError: Cannot convert undefined or null to object 如何处理 #378

Description

@lupeng1996

vue和ui框架

vue3、element-plus

问题描述

在oneOf中 一种type为string 一种type为object,默认数据为object,在切换时,会报错,TypeError: Cannot convert undefined or null to object 如何处理

{
  "oneOf": [
    {
      "type": "string",
      "description": "Default language translation"
    },
    {
      "properties": {
        "zh_CN": {
          "type": "string",
          "description": "ZH_CN translation"
        },
        "en_US": {
          "type": "string",
          "description": "EN_US translation"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "description": "Multi-language translations"
    }
  ],
  "title": "Label",
  "description": "国际化字段类型",
  "default": {
    "zh_CN": "None",
    "en_US": "None"
  }
}

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions