sensitive - 渲染一个可揭示的密码字段,可用于敏感信息,例如 API 密钥或秘钥, 配置值, 等. 一个敏感字段可以在用户的请求下切换可见和隐藏。
包含先前输入值的敏感字段,在加载时其值将被占位符值替换,以防止该值通过长度被猜测或被复制。在显示该值时,原始值通过 AJAX 检索并填充到该字段中。
api_secret:
type: sensitive
allowCopy: false
hideOnTabChange: true以下字段属性受支持且常用。
| Property | Description |
|---|---|
| label | a name when displaying the form field to the user. |
| default | specifies a default string value, optional. |
| comment | places a descriptive comment below the field. |
| mode | display mode for the widget, either textarea or text. Default: text |
| allowCopy | adds a "copy" action to the sensitive field, allowing the user to copy the password without revealing it. Default: true |
| hiddenPlaceholder | sets the placeholder text that is used to simulate a hidden, unrevealed value. You can change this to a long or short string to emulate different length values. Default: __hidden__ |
| hideOnTabChange | if true, the sensitive field will automatically be hidden if the user navigates to a different tab, or minimizes their browser. Default: true |