Microsoft.Common.PasswordBox UI 元素Microsoft.Common.PasswordBox UI element
一个可以用来提供和确认密码的控件。A control that can be used to provide and confirm a password.
UI 示例UI sample
架构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 thedefaultValue
property. - 有关
constraints
的实现详细信息,请参阅 Microsoft.Common.TextBox。For implementation details ofconstraints
, see Microsoft.Common.TextBox. - 如果
options.hideConfirmation
设置为 true,则用于确认用户密码的第二个文本框会被隐藏。Ifoptions.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
- 有关创建 UI 定义的简介,请参阅 CreateUiDefinition 入门。For an introduction to creating UI definitions, see Getting started with CreateUiDefinition.
- 有关 UI 元素中的公用属性的说明,请参阅 CreateUiDefinition 元素。For a description of common properties in UI elements, see CreateUiDefinition elements.