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

632 ℃

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,我们会在看到邮件的第一时间内为您处理!

Fighting Design中文文档官网介绍
织梦cms首页从用文章中直接获取显示多张图片显示
wordpress如何实现img图片自动添加alt和title
vuejs项目兼容ie浏览器
帝国CMS(EmpireCMS)如何在列表页加入收藏