封装方法

1.隐藏手机号中间四位
export function formatPhone(phone){
if (typeof phone == 'number') {
phone = phone.toString();
}
return phone.substr(0, 3) + '****' + phone.substr(7, 11);
}
 
原文地址:https://www.cnblogs.com/lj8023/p/10516561.html