添加滑块验证注释
This commit is contained in:
		
							parent
							
								
									b728e340a0
								
							
						
					
					
						commit
						5143f2b83f
					
				@ -18,6 +18,7 @@
 | 
				
			|||||||
import { getVerifyImg, postVerifyImg } from './verify.js';
 | 
					import { getVerifyImg, postVerifyImg } from './verify.js';
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  props: {
 | 
					  props: {
 | 
				
			||||||
 | 
					    // 传入数据,判断是登录、注册、修改密码
 | 
				
			||||||
    verifyType: {
 | 
					    verifyType: {
 | 
				
			||||||
      defalut: 'LOGIN',
 | 
					      defalut: 'LOGIN',
 | 
				
			||||||
      type: String
 | 
					      type: String
 | 
				
			||||||
@ -43,10 +44,12 @@ export default {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
 | 
					    // 鼠标按下事件,开始拖动滑块
 | 
				
			||||||
    mouseDown (e) {
 | 
					    mouseDown (e) {
 | 
				
			||||||
      this.downX = e.clientX;
 | 
					      this.downX = e.clientX;
 | 
				
			||||||
      this.flag = true;
 | 
					      this.flag = true;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 鼠标移动事件,计算距离
 | 
				
			||||||
    mouseMove (e) {
 | 
					    mouseMove (e) {
 | 
				
			||||||
      if (this.flag) {
 | 
					      if (this.flag) {
 | 
				
			||||||
        let offset = e.clientX - this.downX;
 | 
					        let offset = e.clientX - this.downX;
 | 
				
			||||||
@ -60,6 +63,7 @@ export default {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 鼠标抬起事件,验证是否正确
 | 
				
			||||||
    mouseUp () {
 | 
					    mouseUp () {
 | 
				
			||||||
      if (!this.flag) return false;
 | 
					      if (!this.flag) return false;
 | 
				
			||||||
      this.flag = false;
 | 
					      this.flag = false;
 | 
				
			||||||
@ -108,7 +112,7 @@ export default {
 | 
				
			|||||||
      handler: function (v) {
 | 
					      handler: function (v) {
 | 
				
			||||||
        this.type = v;
 | 
					        this.type = v;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    },
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,7 @@
 | 
				
			|||||||
import { getVerifyImg, postVerifyImg } from './verify.js';
 | 
					import { getVerifyImg, postVerifyImg } from './verify.js';
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  props: {
 | 
					  props: {
 | 
				
			||||||
 | 
					    // 传入数据,判断是登录、注册、修改密码
 | 
				
			||||||
    verifyType: {
 | 
					    verifyType: {
 | 
				
			||||||
      defalut: 'LOGIN',
 | 
					      defalut: 'LOGIN',
 | 
				
			||||||
      type: String
 | 
					      type: String
 | 
				
			||||||
@ -43,10 +44,12 @@ export default {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
 | 
					    // 鼠标按下事件,开始拖动滑块
 | 
				
			||||||
    mouseDown (e) {
 | 
					    mouseDown (e) {
 | 
				
			||||||
      this.downX = e.clientX;
 | 
					      this.downX = e.clientX;
 | 
				
			||||||
      this.flag = true;
 | 
					      this.flag = true;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 鼠标移动事件,计算距离
 | 
				
			||||||
    mouseMove (e) {
 | 
					    mouseMove (e) {
 | 
				
			||||||
      if (this.flag) {
 | 
					      if (this.flag) {
 | 
				
			||||||
        let offset = e.clientX - this.downX;
 | 
					        let offset = e.clientX - this.downX;
 | 
				
			||||||
@ -60,6 +63,7 @@ export default {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 鼠标抬起事件,验证是否正确
 | 
				
			||||||
    mouseUp () {
 | 
					    mouseUp () {
 | 
				
			||||||
      if (!this.flag) return false;
 | 
					      if (!this.flag) return false;
 | 
				
			||||||
      this.flag = false;
 | 
					      this.flag = false;
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,7 @@
 | 
				
			|||||||
import { getVerifyImg, postVerifyImg } from './verify.js';
 | 
					import { getVerifyImg, postVerifyImg } from './verify.js';
 | 
				
			||||||
export default {
 | 
					export default {
 | 
				
			||||||
  props: {
 | 
					  props: {
 | 
				
			||||||
 | 
					    // 传入数据,判断是登录、注册、修改密码
 | 
				
			||||||
    verifyType: {
 | 
					    verifyType: {
 | 
				
			||||||
      defalut: 'LOGIN',
 | 
					      defalut: 'LOGIN',
 | 
				
			||||||
      type: String
 | 
					      type: String
 | 
				
			||||||
@ -43,10 +44,12 @@ export default {
 | 
				
			|||||||
    };
 | 
					    };
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  methods: {
 | 
					  methods: {
 | 
				
			||||||
 | 
					    // 鼠标按下事件,开始拖动滑块
 | 
				
			||||||
    mouseDown (e) {
 | 
					    mouseDown (e) {
 | 
				
			||||||
      this.downX = e.clientX;
 | 
					      this.downX = e.clientX;
 | 
				
			||||||
      this.flag = true;
 | 
					      this.flag = true;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 鼠标移动事件,计算距离
 | 
				
			||||||
    mouseMove (e) {
 | 
					    mouseMove (e) {
 | 
				
			||||||
      if (this.flag) {
 | 
					      if (this.flag) {
 | 
				
			||||||
        let offset = e.clientX - this.downX;
 | 
					        let offset = e.clientX - this.downX;
 | 
				
			||||||
@ -60,6 +63,7 @@ export default {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    // 鼠标抬起事件,验证是否正确
 | 
				
			||||||
    mouseUp () {
 | 
					    mouseUp () {
 | 
				
			||||||
      if (!this.flag) return false;
 | 
					      if (!this.flag) return false;
 | 
				
			||||||
      this.flag = false;
 | 
					      this.flag = false;
 | 
				
			||||||
@ -108,7 +112,7 @@ export default {
 | 
				
			|||||||
      handler: function (v) {
 | 
					      handler: function (v) {
 | 
				
			||||||
        this.type = v;
 | 
					        this.type = v;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user