vue对银行卡,手机号,姓名,身份证进行加密保护用*代替
<div id="app"><ul><li v-for="item in num">{{item | hideMiddle}}</li></ul></div><script src="https://cdn.jsdelivr.net/npm/vue"></script><script type="
·
<div id="app">
<ul>
<li v-for="item in num">{{item | hideMiddle}}</li>
</ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script type="text/javascript">
new Vue({
el: '#app',
data: {
num: ["1234567897897","5648754542132"]
},
methods: {
},
filters: {
hideMiddle(val) {
return `${val.substring(0,3)}****${val.substring(val.length-3)}`
}
}
})
</script>
更多推荐
已为社区贡献11条内容
所有评论(0)