组件
密码输入框
带显示切换按钮的密码字段。
用法
基础
HTML
<bs:bsui-password-input placeholder="Your password" />设置并确认
常见的一组配对字段,各自带有标签和表单名称。
HTML
<bs:bsui-stack direction="column" gap="4" align="stretch">
<bs:bsui-field>
<bs:bsui-field-label text="New password" />
<bs:bsui-password-input name="password" placeholder="At least 12 characters" />
</bs:bsui-field>
<bs:bsui-field>
<bs:bsui-field-label text="Confirm password" />
<bs:bsui-password-input name="password_confirm" placeholder="Repeat it" />
</bs:bsui-field>
</bs:bsui-stack>输入无效
字段无效时,控件会改变颜色并显示错误消息。
HTML
<bs:bsui-field invalid="true">
<bs:bsui-field-label text="Password" />
<bs:bsui-password-input placeholder="Enter password" />
<bs:bsui-field-error text="Use at least 12 characters and one number." />
</bs:bsui-field>已禁用
显示内容的按钮和字段一起锁定。
HTML
<bs:bsui-password-input placeholder="Managed by your identity provider" disabled="true" />属性
| 属性 | 类型 | 默认 |
|---|---|---|
name | text | — |
placeholder | text | Enter password |
disabled | toggle | false |
nameAlt | text | — |
onChange | text | — |
value | text | — |
inputId | text | — |
ariaLabel | text | — |
autocomplete | text | — |