首页
it技术
登录
6mi
u
盘
搜
搜 索
it技术
用filter用星号替代中间的位数
用filter用星号替代中间的位数
it
2024-03-30
69
formatPhone(phone){ let num = Number(phone);
if(!num){ return num || '' ; }else{ const reg = /^(\d{3})\d+(\d{4})$/; return num.toString().replace(reg, '$1****$2') || '' } }, 通过全局使用filter,然后我们就能使用了
转载请注明原文地址: https://lol.8miu.com/read-15151.html
最新回复
(
0
)