InputNumber support Form's disabled

This commit is contained in:
梁灏 2019-09-16 22:03:00 +08:00
parent 35d896af03
commit 4df3007a56

View file

@ -16,7 +16,7 @@
<input <input
:id="elementId" :id="elementId"
:class="inputClasses" :class="inputClasses"
:disabled="disabled" :disabled="itemDisabled"
autocomplete="off" autocomplete="off"
spellcheck="false" spellcheck="false"
:autofocus="autofocus" :autofocus="autofocus"
@ -36,6 +36,7 @@
<script> <script>
import { oneOf, findComponentUpward } from '../../utils/assist'; import { oneOf, findComponentUpward } from '../../utils/assist';
import Emitter from '../../mixins/emitter'; import Emitter from '../../mixins/emitter';
import mixinsForm from '../../mixins/form';
const prefixCls = 'ivu-input-number'; const prefixCls = 'ivu-input-number';
const iconPrefixCls = 'ivu-icon'; const iconPrefixCls = 'ivu-icon';
@ -66,7 +67,7 @@
export default { export default {
name: 'InputNumber', name: 'InputNumber',
mixins: [ Emitter ], mixins: [ Emitter, mixinsForm ],
props: { props: {
max: { max: {
type: Number, type: Number,
@ -146,7 +147,7 @@
`${prefixCls}`, `${prefixCls}`,
{ {
[`${prefixCls}-${this.size}`]: !!this.size, [`${prefixCls}-${this.size}`]: !!this.size,
[`${prefixCls}-disabled`]: this.disabled, [`${prefixCls}-disabled`]: this.itemDisabled,
[`${prefixCls}-focused`]: this.focused [`${prefixCls}-focused`]: this.focused
} }
]; ];
@ -216,7 +217,7 @@
this.changeStep('down', e); this.changeStep('down', e);
}, },
changeStep (type, e) { changeStep (type, e) {
if (this.disabled || this.readonly) { if (this.itemDisabled || this.readonly) {
return false; return false;
} }