<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>

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐