this.$prompt如何做手机号码验证(判断手机号码是否正确)

716 ℃

element中的this.$prompt事件如何做手机号码验证,下面web建站小编给大家简单介绍一下具体实现代码!

editPhone() {
  this.$prompt('您确定要修改当前手机号码', '温馨提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    inputPattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
    inputValidator: (val) => {
      if (val === null) {
    return true
      }
      return !(val.length > 11 || val.length < 11)
    },
    inputErrorMessage: '格式不正确'
  }).then(({ value }) => {
    this.rowCurr.patientPhone = value
  }).catch(() => {
    this.$message({
      type: 'info',
      message: '取消输入'
    })
  })
},

this.$prompt输入框中显示默认值、校验等功能

标签: this.$prompt, 手机号码验证

上面是“this.$prompt如何做手机号码验证(判断手机号码是否正确)”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。

当前网址:https://m.ipkd.cn/webs_4464.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

用最简单方法实现mysql批量插入数据(for循环)
利用html5+css3实现滚雪球效果(附代码)
如何利用php语法实现留言板的回复功能(前后端结合)
php语法中%3c是什么意思,怎么用
小黄蕉