当前位置:网站首页>js显示隐藏手机号
js显示隐藏手机号
2022-08-02 23:44:00 【@小朱呀路】


<template>
<view>
<view class="flex a-c" style="height: 100rpx;width: 100%; ">
<view class="" style="height: 50rpx " >
{
{
xphonenumbool?allphonenum:isunum}}
</view>
<view class="aj-c" @click="select" style="width: 100rpx;height: 50rpx ">
<!-- 方法很多
<image v-if="!xphonenumbool" src="../../static/noseay.png" ></image>
<image v-if="xphonenumbool" src="../../static/yeseay.png" ></image>
-->
<image :src="`../../static/${
!xphonenumbool?'noseay':'yeseay'}.png`" >
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
allphonenum: '18338088912',
xphonenum: '',
xphonenumbool: false,
}
},
methods: {
select() {
this.xphonenumbool = !this.xphonenumbool;
},
},
computed: {
isunum: function() {
const newarr = this.allphonenum.split('');
newarr.forEach((item, index, arr) => {
if (index > 2 && index < 7) {
arr[index] = '*'
}
})
return newarr.join('');
}
}
}
</script>
<style>
image {
width: 100%;
height: 100%;
}
</style>
边栏推荐
猜你喜欢
随机推荐
思源笔记 本地存储无使用第三方同步盘,突然打不开文件。
d合并json
js基础知识整理之 —— 获取元素和命名规范
年近30 ,4月无情被辞,想给划水的兄弟提个醒...
2022 China Eye Expo, Shandong Eye Health Exhibition, Vision Correction Instrument Exhibition, Eye Care Products Exhibition
Jenkins汉化设置
【系统架构设计师】第三章 数据库系统
js基础知识整理之 —— 判断语句和三元运算符
Visual Studio中vim模拟器
Let's talk about the charm of code language
浅谈I2C知识
2022第十一届财经峰会:优炫软件斩获双项大奖
TensorFlow学习记录(一):基本介绍
程序员常说的“左手锟斤拷,右手烫烫烫”是怎么回事?
优秀论文以及思路分析02
Merge two excel spreadsheet tools
Canonical correlation analysis of CCA calculation process
十年架构五年生活-03作为技术组长的困扰
resubmit 渐进式防重复提交框架简介
Connect the Snowflake of CKAN tutorial CKAN to release to open data portal









