<text v-if="item.show">
{{item.mobile}}
</text>
<text v-else>
{{item.mobile | formatPhone}}
</text>
<view class="" style="" @click="toggle(item,index)">
<image mode="widthFix" style="" :src="item.show ? '../../static/user/openeye.png' :
'../../static/user/eye.jpg'">
</image>
</view>
this.appointment.forEach(item => {
this.$set(item, 'show', false)
})
toggle(obj, index) {
this.mobile = obj.mobile;
this.appointment[index].show = !this.appointment[index].show
},
Vue.filter('formatPhone', (val) => {
if (val) {
const card = val
// console.log(tel,'过滤器');
return card.substr(0, 3) + "****" + card.substr(7);
}
})
手机号、身份证号显示与隐藏
于 2023-06-29 17:07:27 首次发布