// 需求:输入座机号只允许输入数字和"-"
onChange(e){
this.$nextTick(()=>{
this.phone = e.target.value.replace(/[^0-9-]/g, '');
})
}
解决:添加**this.$nextTick**即可
10-18
1561
06-09
// 需求:输入座机号只允许输入数字和"-"
onChange(e){
this.$nextTick(()=>{
this.phone = e.target.value.replace(/[^0-9-]/g, '');
})
}
解决:添加**this.$nextTick**即可