Kaynağa Gözat

chore: optimize code (#13214)

hetech 6 yıl önce
ebeveyn
işleme
87f448f8dd

+ 1 - 1
packages/radio/src/radio-button.vue

@@ -99,7 +99,7 @@
         return this.disabled || this._radioGroup.disabled || (this.elForm || {}).disabled;
       },
       tabIndex() {
-        return !this.isDisabled ? (this._radioGroup ? (this.value === this.label ? 0 : -1) : 0) : -1;
+        return (this.isDisabled || (this._radioGroup && this.value !== this.label)) ? -1 : 0;
       }
     },
 

+ 1 - 1
packages/radio/src/radio.vue

@@ -115,7 +115,7 @@
           : this.disabled || (this.elForm || {}).disabled;
       },
       tabIndex() {
-        return !this.isDisabled ? (this.isGroup ? (this.model === this.label ? 0 : -1) : 0) : -1;
+        return (this.isDisabled || (this.isGroup && this.model !== this.label)) ? -1 : 0;
       }
     },