Skip to content

Commit

Permalink
Button: fix disabled priority
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 committed Oct 9, 2021
1 parent 492ab00 commit 74f68ef
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/button/src/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<button
class="el-button"
@click="handleClick"
:disabled="buttonDisabled || loading"
:disabled="disabled || loading"
:autofocus="autofocus"
:type="nativeType"
:class="[
type ? 'el-button--' + type : '',
buttonSize ? 'el-button--' + buttonSize : '',
{
'is-disabled': buttonDisabled,
'is-disabled': disabled,
'is-loading': loading,
'is-plain': plain,
'is-round': round,
Expand Down Expand Up @@ -50,7 +50,12 @@
default: 'button'
},
loading: Boolean,
disabled: Boolean,
disabled: {
type: Boolean,
default() {
return (this.elForm || {}).disabled;
}
},
plain: Boolean,
autofocus: Boolean,
round: Boolean,
Expand All @@ -63,9 +68,6 @@
},
buttonSize() {
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
},
buttonDisabled() {
return this.disabled || (this.elForm || {}).disabled;
}
},
Expand Down

0 comments on commit 74f68ef

Please sign in to comment.