vue身份证号脱敏显示
一般后台返回全部的身份证号,我们前端需要对其数据进行处理,将中间的年月日用*****表示。有时候后台会给你返回一半的身份证号,中间用,分隔,我们也需要将其数据处理,如图。以上方法可实现对身份证号的脱敏显示。...
·
一般后台返回全部的身份证号,我们前端需要对其数据进行处理,将中间的年月日用*****表示
<el-table-column align="center" label="认证身份证号" prop="idCard" width="160">
<template slot-scope="scope">
{{scope.row.idCard? scope.row.idCard.replace(/^(.{6})(?:\w+)(.{4})$/,
"\$1******\$2"):""}}
</template>
</el-table-column>
效果图:
有时候后台会给你返回一半的身份证号,中间用,分隔,我们也需要将其数据处理,如图

<el-table-column align="center" label="认证身份证号" prop="idCard" width="160">
<template slot-scope="scope">
{{{{scope.row.idCard.replace(",","******")}}}}
</template>
</el-table-column>
效果图:

以上方法可实现对身份证号的脱敏显示
更多推荐



所有评论(0)