Microsoft.Common.OptionsGroup UI 元素Microsoft.Common.OptionsGroup UI element

一个具有一行可用选项的选择控件。A selection control with a row of available options.

UI 示例UI sample

Microsoft.Common.OptionsGroup

架构Schema

{
  "name": "element1",
  "type": "Microsoft.Common.OptionsGroup",
  "label": "Some options group",
  "defaultValue": "Value two",
  "toolTip": "",
  "constraints": {
    "allowedValues": [
      {
        "label": "Value one",
        "value": "one"
      },
      {
        "label": "Value two",
        "value": "two"
      }
    ],
    "required": true
  },
  "visible": true
}

示例输出Sample output

"two"

备注Remarks

  • constraints.allowedValues 的标签是项的显示文本,并且当选中时,其值是元素的输出值。The label for constraints.allowedValues is the display text for an item, and its value is the output value of the element when selected.
  • 如果已指定,则默认值必须是 constraints.allowedValues 中存在的一个标签。If specified, the default value must be a label present in constraints.allowedValues. 如果未指定,则默认情况下将选择 constraints.allowedValues 中的第一个项。If not specified, the first item in constraints.allowedValues is selected by default. 默认值为 nullThe default value is null.
  • constraints.allowedValues 必须至少有一项。constraints.allowedValues must have at least one item.

后续步骤Next steps