Skip to content

为什么文档中 mode 属性的类型标记为 Mode #106

Open
@EmptyDreams

Description

@EmptyDreams

Consultation Description

我注意到在文档(及代码中的类型标记)中,mode 属性被设置为 Mode 类型,我有以下几个问题:

  1. 为什么文档中使用 Mode 类型,但 demo 中却将 mode 填入 string 类型?
  2. 为什么 json-editor-vue 没有内置 Mode 类型?如果我想使用这个类型,为什么还需要额外安装一个库?
  3. 这里的设计是否存在问题?是否应该在类型定义时就同时允许这两种类型?按照当前的设计,我只能在以下两种方案中二选一:
    • 安装一个额外的库(仅为了使用 Mode 类型),或者
    • 忍受代码静态检查抛出的警告(因为类型标记不允许传入 string 类型,而静态检查器不支持屏蔽此类警告)。

Validation

  • ⚠️ I understand that using this for unrelated purposes can lead to it being closed without further notice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions