Microsoft.Common.PasswordBox UI 元素Microsoft.Common.PasswordBox UI element

一个可以用来提供和确认密码的控件。A control that can be used to provide and confirm a password.

UI 示例UI sample

Microsoft.Common.PasswordBox

架构Schema

{
  "name": "element1",
  "type": "Microsoft.Common.PasswordBox",
  "label": {
    "password": "Password",
    "confirmPassword": "Confirm password"
  },
  "toolTip": "",
  "constraints": {
    "required": true,
    "regex": "^[a-zA-Z0-9]{8,}$",
    "validationMessage": "Password must be at least 8 characters long, contain only numbers and letters"
  },
  "options": {
    "hideConfirmation": false
  },
  "visible": true
}

示例输出Sample output

"p4ssw0rd"

备注Remarks

  • 此元素不支持 defaultValue 属性。This element doesn't support the defaultValue property.
  • 有关 constraints 的实现详细信息,请参阅 Microsoft.Common.TextBoxFor implementation details of constraints, see Microsoft.Common.TextBox.
  • 如果 options.hideConfirmation 设置为 true,则用于确认用户密码的第二个文本框会被隐藏。If options.hideConfirmation is set to true, the second text box for confirming the user's password is hidden. 默认值是 false秒。The default value is false.

后续步骤Next steps