手机号:
{{ 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";