当前位置:网站首页>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>
边栏推荐
猜你喜欢
随机推荐
alibaba数据同步组件canal的实践整理
Visual Studio中vim模拟器
华为设备配置BFD与接口联动(触发与BFD联动的接口物理状态变为Down)
mPEG-Cholesterol,mPEG-CLS,甲氧基-聚乙二醇-胆固醇可用于脂质体制备
【mysql知识点整理】--- order by 、group by 出现Using filesort原因详解
CKAN教程之在 AWS 上部署 CKAN 应用程序
js基础知识整理之 —— 获取元素和命名规范
机器学习-特征映射方法
Mock工具之Moco使用教程
【多线程】线程与进程、以及线程进程的调度
DataGuard日常维护常见问题之数据同步异常
VMware workstation program starts slowly
同一份数据,Redis为什么要存两次?
Jenkins汉化设置
CIO修炼手册:成功晋升CIO的七个秘诀
有奖提问|《新程序员》专访“Apache之父”Brian Behlendorf
What is the matter that programmers often say "the left hand is knuckled and the right hand is hot"?
4、Citrix MCS云桌面无法安装todesk等软件
九零后程序员心声:互联网的同行们,别卷了,再卷人都卷没了
# DWD层及DIM层构建## ,220801 ,