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