手机号隐藏

yundejia

关注

阅读 137

2022-05-30


手机号:
{{ telShow ? changetel(userInfo.contactWay) : userInfo.contactWay }}
{{
telShow ? "显示" : "隐藏"
}}

changetel(tel) {
return getTel(tel);
},
//显示手机号
showTelClick(tel) {
console.log("tel", tel);
this.telShow = !this.telShow;
},

export function getTel(tel) {
let reg = /^(\d{3})\d{4}(\d{4})$/;
if (tel) {
return tel.replace(reg, "$1****$2")
} else {
return ""
}
}

import { formatDate, getTel } from "@/filters/index.js";

精彩评论(0)

0 0 举报