当前位置:网站首页>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>
边栏推荐
猜你喜欢
随机推荐
js基础知识整理之 —— Date和定时器
21天学习挑战赛(1)设备树的由来
定了!8月起,网易将为本号粉丝提供数据分析培训,费用全免!
稳压电源: 电路图及类型
如何修复 SAP UI5 aggregation with cardinality 0..1 相关的错误消息
2022暑假牛客多校1 (A/G/D/I)
Servlet——请求(request)与响应(response)
关于地图GIS开发事项的一次实践整理(上)
Cholesterol-PEG-Amine,CLS-PEG-NH2,胆固醇-聚乙二醇-氨基脂两亲性脂质衍生物
alibaba数据同步组件canal的实践整理
剑指 Offer 21. 调整数组顺序使奇数位于偶数前面
用了这么多年的LinkedList,作者说自己从来不用它?为什么?
DownMusic summary record
我们来浅谈代码语言的魅力
LVM与磁盘配额原理及配置
DownMusic总结记录
mPEG-Cholesterol,mPEG-CLS,甲氧基-聚乙二醇-胆固醇可用于脂质体制备
用了 TCP 协议,数据一定不会丢吗?
pytest-常用运行参数
VMware workstation program starts slowly









