敏感信息 Secret
默认以占位符隐藏文本,点击图标后显示原始内容,并保留复制入口。
自定义隐藏占位
Section titled “自定义隐藏占位”通过 hidden-text 调整隐藏状态下的展示内容,适合手机号、证件号等场景。
受控显示状态
Section titled “受控显示状态”通过 v-model:visible 在外部管理显示状态,便于和表单或其它交互联动。
关闭复制入口
Section titled “关闭复制入口”当只允许查看、不允许复制时,可以通过 show-copy 关闭复制按钮。
<secret> Props
Section titled “<secret> Props”| 参数名 | 描述 | 类型 | 默认值 | 版本 |
|---|---|---|---|---|
| text | 原始敏感文本 | string | - | |
| hidden-text | 隐藏状态下展示的占位内容 | string | '********' | |
| show-copy | 是否显示复制按钮 | boolean | true | |
| visible | 当前是否显示原始文本,支持 v-model:visible | boolean | false |
<secret> Events
Section titled “<secret> Events”| 事件名 | 描述 | 参数 |
|---|---|---|
| update:visible | 点击显示/隐藏按钮时触发 | value: boolean |
当前组件不提供额外 slots 或 expose 方法,主要通过 props 和 v-model:visible 完成交互控制。