vue将电话号码中间的几位数隐藏显示


 

vue中具体用法:

phoneNumFilter (phone) {
// 1字符串转化成数组
let phoneArr = [...phone];
// 2.将数组中的4-7位变成*
phoneArr.map((res, index) => {
if (index > 2 && index < 7) {
this.str += '*';
// return '*';
} else {
this.str += res;
// return res;
}
});
return this.str;
}

 

此处仅作交流学习,版权归原作者所有


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM