# t-text-sensitive
TextSensitive 敏感文本
t-text-sensitive 组件介绍
t-text-sensitive 是用于敏感信息脱敏显示的文本组件,支持手机号、身份证号、银行卡号等敏感信息的脱敏处理,保护用户隐私。
t-text-sensitive 平台兼容
| Harmony | H5 | Android | iOS | 小程序 | UTS |
|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
t-text-sensitive 基础用法
基础用法参考 demo/text-sensitive/text-sensitive.uvue。
vue
<template>
<view
class='p-15'>
<t-card title="Text 文本"
class="mb-15"
sub-title="敏感信息隐藏"></t-card>
<t-section title="敏感信息隐藏"
class='mb-15' />
<view class="[`mb-15 r-10 p-10 tvg`]">
<t-text-sensitive class="mb-8"
type="error">张</t-text-sensitive>
<t-text-sensitive class="mb-8"
type="success">王李</t-text-sensitive>
<t-text-sensitive class="mb-8"
type="warning">赵钱孙</t-text-sensitive>
<t-text-sensitive class="mb-8"
type="primary">18059547994</t-text-sensitive>
</view>
</view>
</template>
<script setup>
// 空 setup,不需要数据和方法
</script>t-text-sensitive Props
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
text | 需要脱敏显示的文本 | string | '' |
format | 格式化格式(预留) | string | 'yyyy-mm-dd hh:MM:ss' |
path | 点击组件后跳转的页面路径;为空时仅响应事件 | string | '' |
hover | 是否启用点击效果 | boolean | true |
type | 组件主题类型,可选 info、primary、error、warning、success | string | '' |
disabled | 是否禁用 | boolean | false |
effect | 组件显示主题,可选 normal、dark、light、plain | string | '' |
size | 组件尺寸,可选 large、medium、small、mini | string | 'medium' |
t-text-sensitive Events
| 事件名 | 说明 | 回调参数 |
|---|---|---|
click | 点击时触发 | event |
initFinished | 组件初始化完成触发 | 组件节点信息 |
touchstart | 触摸开始时触发 | event |
touchend | 触摸结束时触发 | event |
touchmove | 触摸移动时触发 | event |
touchcancel | 触摸取消时触发 | event |