12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 | ##登录 请输入正确的手机号码! data() { return { phone:'', rightshow:false, // 正确图标 errshow:false, //错误图标 } }, methods: { getphone() { let reg = /^1[0-9]{10}$/; //正则表达式 ,1代表手机号的第一位1 ,[0-9]{10}代表后面10个数字,在0-9里面随机 if (!reg.test(this.phone)) { //!就代表当 不符合这个规则, !reg.test(this.phone)这个也是语法来的 this.errshow = true; this.rightshow = false; } else { this.errshow = false; this.rightshow = true; } } h2 { font-size: 25px; color: red; margin-bottom: 20px;}.signin { width: 600px; margin: 50px auto;}.signin input { display: inline-block; width: 350px; margin-bottom: 20px; border-radius: .1rem;}.signin button { width: 350px; height: 50px; }.signin-item { position: relative;}.signin-item .iconkekan { position: absolute; right: 42%; padding-top: 20px; padding-right: 10px; font-size: 18px;}.signin-item .iconkekan-hover { color: #DA1A14;} |