mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	fix: 修复获取验证码倒计时会有 1s 延时禁用的问题
				
					
				
			This commit is contained in:
		
							parent
							
								
									7ffd7e2d7d
								
							
						
					
					
						commit
						6776e85641
					
				@ -17,11 +17,12 @@ export const useVerifyCode = () => {
 | 
			
		||||
    await formEl.validateField(props, isValid => {
 | 
			
		||||
      if (isValid) {
 | 
			
		||||
        clearInterval(timer.value);
 | 
			
		||||
        isDisabled.value = true;
 | 
			
		||||
        text.value = `${time}`;
 | 
			
		||||
        timer.value = setInterval(() => {
 | 
			
		||||
          if (time > 0) {
 | 
			
		||||
            text.value = `${time}`;
 | 
			
		||||
            isDisabled.value = true;
 | 
			
		||||
            time -= 1;
 | 
			
		||||
            text.value = `${time}`;
 | 
			
		||||
          } else {
 | 
			
		||||
            text.value = "";
 | 
			
		||||
            isDisabled.value = false;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user