mirror of https://github.com/ElemeFE/element
Button: inherit disabled from wrapping Form (#10275)
parent
1362bae57d
commit
3934e8f3ba
|
@ -2,14 +2,14 @@
|
||||||
<button
|
<button
|
||||||
class="el-button"
|
class="el-button"
|
||||||
@click="handleClick"
|
@click="handleClick"
|
||||||
:disabled="disabled || loading"
|
:disabled="buttonDisabled || loading"
|
||||||
:autofocus="autofocus"
|
:autofocus="autofocus"
|
||||||
:type="nativeType"
|
:type="nativeType"
|
||||||
:class="[
|
:class="[
|
||||||
type ? 'el-button--' + type : '',
|
type ? 'el-button--' + type : '',
|
||||||
buttonSize ? 'el-button--' + buttonSize : '',
|
buttonSize ? 'el-button--' + buttonSize : '',
|
||||||
{
|
{
|
||||||
'is-disabled': disabled,
|
'is-disabled': buttonDisabled,
|
||||||
'is-loading': loading,
|
'is-loading': loading,
|
||||||
'is-plain': plain,
|
'is-plain': plain,
|
||||||
'is-round': round
|
'is-round': round
|
||||||
|
@ -26,6 +26,9 @@
|
||||||
name: 'ElButton',
|
name: 'ElButton',
|
||||||
|
|
||||||
inject: {
|
inject: {
|
||||||
|
elForm: {
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
elFormItem: {
|
elFormItem: {
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
|
@ -58,6 +61,9 @@
|
||||||
},
|
},
|
||||||
buttonSize() {
|
buttonSize() {
|
||||||
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
|
||||||
|
},
|
||||||
|
buttonDisabled() {
|
||||||
|
return this.disabled || (this.elForm || {}).disabled;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue