uniapp隐藏手机号中间四位改成****
修改手机号码字段。
·
<view class="name">{{phone}}</view>
<script>
export default {
data() {
return {
phone: '13622229999',
};
},
onShow() {
this.phoneNumShow()
},
methods: {
//隐藏手机号
phoneNumShow() {
let that = this;
let number = this.phone; //获取到手机号码字段
let mphone = number.substring(0, 3) + '****' + number.substring(7);
that.phone = mphone
console.log(that.phone, '1');
},
}
}
</script>
更多推荐
已为社区贡献1条内容
所有评论(0)