phoneValueFn() {
this.phone=this.phone.replace(/[^0-9]+/,'')
this.phone = this.getSpaceval(' ',this.phone)
this.str = this.phone
if (this.phone.length == 13 && this.keyUpdata) {
this.keyUpdata = false
this.queryClick()
} else {
this.keyUpdata = true
this.datas = []
this.operator = ''
}
},
onPhoneInput() {
// document.addEventListener('paste', (event) => {
// let text = (event.clipboardData || window.clipboardData).getData('text')
// if(text.length === 11){
// this.phone = this.phone.replace(/^(\d{3})(\d{4})(\d{4})$/, '$1 $2 $3').trim();
// }
// })
// 获取到存有⽤户⼿机号码信息的对象
if (this.phone.length === 4) {
// 加⼊trim()以应对退格情况
this.phone = this.phone.replace(/^(\d{3})(\d?)$/, '$1 $2').trim();
} else if (this.p
手机号3-3-4格式,获取手机粘贴板
于 2022-06-20 10:32:05 首次发布